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

Method FillIndicesAndSizes

tensorflow/core/framework/tensor_slice.h:205–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204template <int NDIMS>
205void TensorSlice::FillIndicesAndSizes(
206 const TensorShape& shape, Eigen::DSizes<Eigen::DenseIndex, NDIMS>* indices,
207 Eigen::DSizes<Eigen::DenseIndex, NDIMS>* sizes) const {
208 CHECK_EQ(shape.dims(), dims()) << "Incompatible dimensions between shape "
209 << "slices: shape = " << shape.DebugString()
210 << ", slice = " << DebugString();
211 CHECK_GE(NDIMS, dims()) << "Asking for a " << NDIMS << "-dim slice from "
212 << "a slice of dimension " << dims();
213 for (int d = 0; d < dims(); ++d) {
214 if (IsFullAt(d)) {
215 (*indices)[d] = 0;
216 (*sizes)[d] = shape.dim_size(d);
217 } else {
218 (*indices)[d] = starts_[d];
219 (*sizes)[d] = lengths_[d];
220 }
221 }
222 for (int d = dims(); d < NDIMS; ++d) {
223 (*indices)[d] = 0;
224 (*sizes)[d] = 1;
225 }
226}
227
228} // namespace tensorflow
229

Callers

nothing calls this directly

Calls 5

dimsFunction · 0.85
DebugStringFunction · 0.70
dimsMethod · 0.45
DebugStringMethod · 0.45
dim_sizeMethod · 0.45

Tested by

no test coverage detected