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

Function BinaryOpHelper

tensorflow/c/c_test_util.cc:208–222  ·  view source on GitHub ↗

If `op_device` is non-empty, set the created op on that device.

Source from the content-addressed store, hash-verified

206
207// If `op_device` is non-empty, set the created op on that device.
208void BinaryOpHelper(const char* op_name, TF_Operation* l, TF_Operation* r,
209 TF_Graph* graph, TF_Status* s, const char* name,
210 TF_Operation** op, const string& op_device, bool check) {
211 TF_OperationDescription* desc = TF_NewOperation(graph, op_name, name);
212 if (!op_device.empty()) {
213 TF_SetDevice(desc, op_device.c_str());
214 }
215 TF_AddInput(desc, {l, 0});
216 TF_AddInput(desc, {r, 0});
217 *op = TF_FinishOperation(desc, s);
218 if (check) {
219 ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);
220 ASSERT_NE(*op, nullptr);
221 }
222}
223
224TF_Operation* MinWithDevice(TF_Operation* l, TF_Operation* r, TF_Graph* graph,
225 const string& op_device, TF_Status* s,

Callers 2

MinWithDeviceFunction · 0.85
MulFunction · 0.85

Calls 8

TF_NewOperationFunction · 0.85
TF_SetDeviceFunction · 0.85
TF_AddInputFunction · 0.85
TF_FinishOperationFunction · 0.85
TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85
c_strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected