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

Function NewConstNode

tensorflow/lite/delegates/gpu/common/model_builder.cc:597–611  ·  view source on GitHub ↗

Creates a simple node that holds tensor value.

Source from the content-addressed store, hash-verified

595
596// Creates a simple node that holds tensor value.
597Status NewConstNode(TensorFloat32 t, GraphFloat32* graph,
598 Value<TensorRef<BHWC>>** value) {
599 ConstTensorAttributes attr;
600 attr.tensor = std::move(t);
601 Node* node = graph->NewNode();
602 node->operation.attributes = attr;
603 node->operation.type = ToString(OperationType::CONST);
604 *value = graph->NewValue();
605 RETURN_IF_ERROR(graph->SetProducer(node->id, (*value)->id));
606 // Keep data inside this tensor.
607 (*value)->tensor.ref = attr.tensor.id;
608 (*value)->tensor.type = attr.tensor.kType;
609 (*value)->tensor.shape = attr.tensor.shape;
610 return OkStatus();
611}
612
613Status ParsePoolingAttributes(const TfLitePoolParams* tf_options,
614 const BHWC& input_shape,

Callers 1

ParseMethod · 0.85

Calls 5

OkStatusFunction · 0.85
NewValueMethod · 0.80
ToStringFunction · 0.70
NewNodeMethod · 0.45
SetProducerMethod · 0.45

Tested by

no test coverage detected