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

Function ConstHelper

tensorflow/c/c_test_util.cc:128–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void ConstHelper(TF_Tensor* t, TF_Graph* graph, TF_Status* s, const char* name,
129 TF_Operation** op) {
130 TF_OperationDescription* desc = TF_NewOperation(graph, "Const", name);
131 TF_SetAttrTensor(desc, "value", t, s);
132 ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);
133 TF_SetAttrType(desc, "dtype", TF_TensorType(t));
134 *op = TF_FinishOperation(desc, s);
135 ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);
136 ASSERT_NE(*op, nullptr);
137}
138
139TF_Operation* Const(TF_Tensor* t, TF_Graph* graph, TF_Status* s,
140 const char* name) {

Callers 1

ConstFunction · 0.70

Calls 7

TF_NewOperationFunction · 0.85
TF_SetAttrTensorFunction · 0.85
TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85
TF_SetAttrTypeFunction · 0.85
TF_TensorTypeFunction · 0.85
TF_FinishOperationFunction · 0.85

Tested by

no test coverage detected