| 203 | |
| 204 | template <int NDIMS> |
| 205 | void 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 |
nothing calls this directly
no test coverage detected