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

Method InsertDim

tensorflow/core/framework/tensor_shape.cc:474–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472
473template <class Shape>
474void TensorShapeBase<Shape>::InsertDim(int d, int64 size) {
475 CHECK_GE(d, 0);
476 CHECK_LE(d, dims());
477 if (!kIsPartial) CHECK_GE(size, 0);
478 CHECK_LT(dims(), MaxDimensions());
479 gtl::InlinedVector<int64, 8> vals;
480 AppendTo(*this, &vals);
481 vals.insert(vals.begin() + d, size);
482 ClearAllButDataType();
483 for (auto dval : vals) {
484 AddDim(dval);
485 }
486}
487
488template <class Shape>
489gtl::InlinedVector<int64, 4> TensorShapeBase<Shape>::dim_sizes() const {

Callers 15

OneHotMethod · 0.45
CompileMethod · 0.45
CompileMethod · 0.45
GetTensorArrayShapeFunction · 0.45
CompileMethod · 0.45
CompileMethod · 0.45
AddTestTensorMethod · 0.45
TryInsertManyMethod · 0.45
ComputeMethod · 0.45
ComputeMethod · 0.45
ComputeMethod · 0.45

Calls 4

dimsFunction · 0.85
AppendToFunction · 0.85
insertMethod · 0.45
beginMethod · 0.45

Tested by 1

AddTestTensorMethod · 0.36