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

Function BiasAddGradShape

tensorflow/core/framework/common_shape_fns.cc:580–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580Status BiasAddGradShape(shape_inference::InferenceContext* c) {
581 ShapeHandle input_shape;
582 // Fetch the data_format attribute, which may not exist.
583 string data_format;
584 Status s = c->GetAttr("data_format", &data_format);
585
586 if (s.ok() && data_format == "NCHW") {
587 TF_RETURN_IF_ERROR(c->WithRankAtLeast(c->input(0), 3, &input_shape));
588 c->set_output(0, c->Vector(c->Dim(input_shape, 1)));
589 } else {
590 TF_RETURN_IF_ERROR(c->WithRankAtLeast(c->input(0), 2, &input_shape));
591 c->set_output(0, c->Vector(c->Dim(input_shape, -1)));
592 }
593
594 return Status::OK();
595}
596
597Status CheckFormatConstraintsOnShape(const TensorFormat tensor_format,
598 const ShapeHandle shape_handle,

Callers 1

TESTFunction · 0.85

Calls 7

WithRankAtLeastMethod · 0.80
VectorMethod · 0.80
GetAttrMethod · 0.45
okMethod · 0.45
inputMethod · 0.45
set_outputMethod · 0.45
DimMethod · 0.45

Tested by 1

TESTFunction · 0.68