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

Function TEST_F

tensorflow/core/common_runtime/direct_session_test.cc:131–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129};
130
131TEST_F(DirectSessionMinusAXTest, RunSimpleNetwork) {
132 Initialize({3, 2, -1, 0});
133 auto session = CreateSession();
134 ASSERT_TRUE(session != nullptr);
135 TF_ASSERT_OK(session->Create(def_));
136 std::vector<std::pair<string, Tensor>> inputs;
137
138 // Request two targets: one fetch output and one non-fetched output.
139 std::vector<string> output_names = {y_ + ":0"};
140 std::vector<string> target_nodes = {y_neg_};
141 std::vector<Tensor> outputs;
142 Status s = session->Run(inputs, output_names, target_nodes, &outputs);
143 TF_ASSERT_OK(s);
144
145 ASSERT_EQ(1, outputs.size());
146 // The first output should be initialized and have the correct
147 // output.
148 auto mat = outputs[0].matrix<float>();
149 ASSERT_TRUE(outputs[0].IsInitialized());
150 EXPECT_FLOAT_EQ(5.0, mat(0, 0));
151}
152
153TEST_F(DirectSessionMinusAXTest, RunSimpleNetwork_Callable) {
154 Initialize({3, 2, -1, 0});

Callers

nothing calls this directly

Calls 15

WrapUniqueFunction · 0.85
DefaultFunction · 0.85
mutable_run_optionsMethod · 0.80
CreateSessionFunction · 0.70
MakeCallableOptionsFunction · 0.70
DefaultSessionOptionsFunction · 0.70
NewSessionFunction · 0.70
nameMethod · 0.65
InitializeFunction · 0.50
StrContainsFunction · 0.50
TensorShapeClass · 0.50
ConstantFunction · 0.50

Tested by

no test coverage detected