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

Method Merge

tensorflow/core/framework/shape_inference.cc:465–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463}
464
465Status InferenceContext::Merge(DimensionHandle d0, DimensionHandle d1,
466 DimensionHandle* out) {
467 if (d0.SameHandle(d1)) {
468 *out = d0;
469 return Status::OK();
470 } else if (!ValueKnown(d1)) {
471 *out = d0;
472 merged_dims_.emplace_back(d0, d1);
473 return Status::OK();
474 } else if (!ValueKnown(d0)) {
475 *out = d1;
476 merged_dims_.emplace_back(d0, d1);
477 return Status::OK();
478 } else if (Value(d0) == Value(d1)) {
479 *out = d0;
480 return Status::OK();
481 } else {
482 *out = nullptr;
483 return errors::InvalidArgument("Dimensions must be equal, but are ",
484 Value(d0), " and ", Value(d1));
485 }
486}
487
488Status InferenceContext::MergePrefix(ShapeHandle s, ShapeHandle prefix,
489 ShapeHandle* s_out,

Callers 15

MatMulShapeFunction · 0.45
MatMulGradFilterShapeFunction · 0.45
EinsumShapeFunction · 0.45
BatchMatMulV2ShapeFunction · 0.45
BatchMatMulShapeFunction · 0.45
BiasAddShapeFunction · 0.45
FusedBatchNormShapeFunction · 0.45
FusedBatchNormGradShapeFunction · 0.45
ConcatShapeHelperFunction · 0.45
SliceShapeFunction · 0.45

Calls 8

InvalidArgumentFunction · 0.85
ValueClass · 0.70
DebugStringFunction · 0.70
RankFunction · 0.50
MergeFunction · 0.50
SameHandleMethod · 0.45
emplace_backMethod · 0.45
okMethod · 0.45

Tested by 2

TESTFunction · 0.36
TEST_FFunction · 0.36