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

Function TF_GraphSetTensorShape

tensorflow/c/c_api.cc:686–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684// Shape functions -----------------------------------------------------------
685
686void TF_GraphSetTensorShape(TF_Graph* graph, TF_Output output,
687 const int64_t* dims, const int num_dims,
688 TF_Status* status) {
689 Node* node = &output.oper->node;
690
691 mutex_lock l(graph->mu);
692 tensorflow::shape_inference::InferenceContext* ic =
693 graph->refiner.GetContext(node);
694 if (ic == nullptr) {
695 status->status =
696 InvalidArgument("Node ", node->name(), " was not found in the graph");
697 return;
698 }
699 tensorflow::shape_inference::ShapeHandle new_shape =
700 tensorflow::ShapeHandleFromDims(ic, num_dims, dims);
701 status->status = graph->refiner.SetShape(node, output.index, new_shape);
702}
703
704int TF_GraphGetTensorNumDims(TF_Graph* graph, TF_Output output,
705 TF_Status* status) {

Callers 2

TESTFunction · 0.85

Calls 5

InvalidArgumentFunction · 0.85
ShapeHandleFromDimsFunction · 0.85
nameMethod · 0.65
GetContextMethod · 0.45
SetShapeMethod · 0.45

Tested by 1

TESTFunction · 0.68