MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / reinterpret_last_dimension

Method reinterpret_last_dimension

tensorflow/core/framework/tensor.h:756–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754
755template <typename T, size_t NDIMS>
756typename TTypes<T, NDIMS>::Tensor Tensor::reinterpret_last_dimension() {
757 if (NDIMS == dims()) {
758 return tensor<T, NDIMS>();
759 }
760 CHECK(IsAligned());
761 CHECK_EQ(NDIMS, dims() - 1);
762 CHECK_EQ(sizeof(T), shape_.dim_sizes()[NDIMS] * DataTypeSize(dtype()));
763 Eigen::array<Eigen::DenseIndex, NDIMS> dims;
764 for (int d = 0; d < NDIMS; ++d) {
765 dims[d] = shape_.dim_sizes()[d];
766 }
767 return typename TTypes<T, NDIMS>::Tensor(base<T>(), dims);
768}
769
770template <typename T, size_t NDIMS>
771typename TTypes<T, NDIMS>::ConstTensor Tensor::reinterpret_last_dimension()

Callers

nothing calls this directly

Calls 5

dimsFunction · 0.85
DataTypeSizeFunction · 0.85
TensorClass · 0.70
dtypeFunction · 0.50
dim_sizesMethod · 0.45

Tested by

no test coverage detected