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

Method AddDim

tensorflow/core/framework/tensor_shape.cc:376–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374
375template <class Shape>
376void TensorShapeBase<Shape>::AddDim(int64 size) {
377 if (!kIsPartial) CHECK_GE(size, 0);
378 if (unknown_rank()) return;
379 CHECK_LT(ndims_byte(), MaxDimensions()) << "Too many dimensions in tensor";
380 int64 new_num_elements;
381 if (kIsPartial && (num_elements() < 0 || size < 0)) {
382 new_num_elements = -1;
383 } else {
384 new_num_elements = MultiplyWithoutOverflow(num_elements(), size);
385 CHECK_LE(0, new_num_elements);
386 }
387 UnsafeAddDim(size, new_num_elements);
388}
389
390template <class Shape>
391Status TensorShapeBase<Shape>::AddDimWithStatus(int64 size) {

Callers 15

Proto2TensorFunction · 0.45
mainFunction · 0.45
BatchOneInputFunction · 0.45
SplitOneOutputFunction · 0.45
Proto2TensorFunction · 0.45
MainFunction · 0.45
ComputeAsyncMethod · 0.45
ComputeAsyncMethod · 0.45
ComputeAsyncMethod · 0.45
ComputeAsyncMethod · 0.45
array_ops.ccFile · 0.45
do_periodic_resample_opFunction · 0.45

Calls 1

MultiplyWithoutOverflowFunction · 0.50

Tested by 8

Proto2TensorFunction · 0.36
mainFunction · 0.36
MakeDenseShapesFunction · 0.36
CreateConstSizesOpFunction · 0.36
SetConstSizesOpFunction · 0.36
TEST_FFunction · 0.36
BM_SparseReorderFloatFunction · 0.36
BM_SparseReorderStringFunction · 0.36