Returns the number of elements in the tensor
| 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 |