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

Method dim_size

tensorflow/core/framework/tensor_shape.cc:320–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318
319template <class Shape>
320int64 TensorShapeBase<Shape>::dim_size(int d) const {
321 if (unknown_rank()) return -1;
322 DCHECK_GE(d, 0);
323 DCHECK_LT(d, dims());
324 if (tag() == REP16) {
325 uint16 dim = as16()->dims_[d];
326 if (kIsPartial && dim == kUnknownRep16) return -1;
327 return dim;
328 } else if (tag() == REP32) {
329 uint32 dim = as32()->dims_[d];
330 if (kIsPartial && dim == kUnknownRep32) return -1;
331 return dim;
332 } else {
333 return (*as64()->dims_)[d];
334 }
335}
336
337void TensorShapeRep::Clear() {
338 ClearAllButDataType();

Callers 15

GetTotalKeysNumFunction · 0.45
Proto2TensorFunction · 0.45
BatchOneInputFunction · 0.45
SplitOneOutputFunction · 0.45
Proto2TensorFunction · 0.45
Tensor2ResponseFunction · 0.45
CalculateFlopsFunction · 0.45
SparsifyWeightsFunction · 0.45
ErrorIfNotVectorFunction · 0.45
GetScaleAndOffsetValuesFunction · 0.45

Calls 1

dimsFunction · 0.85

Tested by 15

Proto2TensorFunction · 0.36
TestSetNodeTensorAttrMethod · 0.36
GetTensorShapeFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36