| 181 | } |
| 182 | |
| 183 | int64_t TF_TensorElementCount(const TF_Tensor* t) { |
| 184 | int64_t result = 1; |
| 185 | int rank = TF_NumDims(t); |
| 186 | for (int dim = 0; dim < rank; ++dim) { |
| 187 | result *= TF_Dim(t, dim); |
| 188 | } |
| 189 | return result; |
| 190 | } |
| 191 | |
| 192 | void TF_TensorBitcastFrom(const TF_Tensor* from, TF_DataType type, |
| 193 | TF_Tensor* to, const int64_t* new_dims, |