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

Method RunT

tensorflow/c/c_api_function_test.cc:88–109  ·  view source on GitHub ↗

Run the host graph, which now contains a function and check that outputs are as expected. 'T' stands for 'tensor' since the outputs are tensors, not scalars.

Source from the content-addressed store, hash-verified

86 // outputs are as expected.
87 // 'T' stands for 'tensor' since the outputs are tensors, not scalars.
88 void RunT(const std::vector<std::pair<TF_Operation*, TF_Tensor*>>& inputs,
89 std::initializer_list<TF_Output> outputs,
90 const std::vector<std::vector<int32_t>>& expected_results) {
91 // Create a session for this graph
92 CSession csession(host_graph_, s_);
93 ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_);
94
95 // Run
96 csession.SetInputs(inputs);
97 csession.SetOutputs(outputs);
98 csession.Run(s_);
99 ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_);
100
101 // Check results
102 for (int i = 0; i < expected_results.size(); ++i) {
103 TF_Tensor* out = csession.output_tensor(i);
104 ASSERT_TRUE(out != nullptr);
105 EXPECT_EQ(TF_INT32, TF_TensorType(out));
106 EXPECT_EQ(1, TF_NumDims(out));
107 CompareInt32Tensor(expected_results[i], out);
108 }
109 }
110
111 // Run the host graph, which now contains a function and check that
112 // outputs are as expected.

Callers

nothing calls this directly

Calls 9

TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85
TF_TensorTypeFunction · 0.85
TF_NumDimsFunction · 0.85
SetInputsMethod · 0.45
SetOutputsMethod · 0.45
RunMethod · 0.45
sizeMethod · 0.45
output_tensorMethod · 0.45

Tested by

no test coverage detected