MCPcopy Create free account
hub / github.com/RenderKit/oidn / getNumElements

Method getNumElements

core/tensor_desc.h:122–130  ·  view source on GitHub ↗

Returns the number of elements in the tensor

Source from the content-addressed store, hash-verified

120
121 // Returns the number of elements in the tensor
122 oidn_inline size_t getNumElements() const
123 {
124 if (dims.empty())
125 return 0;
126 size_t num = 1;
127 for (size_t i = 0; i < dims.size(); ++i)
128 num *= size_t(dims[i]);
129 return num;
130 }
131
132 // Returns the size in bytes of the tensor
133 oidn_inline size_t getByteSize() const

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected