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

Function TEST

tensorflow/lite/delegates/gpu/common/model_test.cc:30–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28using ::testing::UnorderedElementsAre;
29
30TEST(Model, SingleNode) {
31 // graph_input -> node -> graph_output
32 GraphFloat32 graph;
33 Node* node = graph.NewNode();
34 Value<TensorRef<BHWC>>* graph_input = graph.NewValue();
35 Value<TensorRef<BHWC>>* graph_output = graph.NewValue();
36 ASSERT_TRUE(graph.AddConsumer(node->id, graph_input->id).ok());
37 ASSERT_TRUE(graph.SetProducer(node->id, graph_output->id).ok());
38
39 EXPECT_THAT(graph.nodes(), UnorderedElementsAre(node));
40 EXPECT_THAT(graph.values(), UnorderedElementsAre(graph_input, graph_output));
41 EXPECT_THAT(graph.inputs(), UnorderedElementsAre(graph_input));
42 EXPECT_THAT(graph.outputs(), UnorderedElementsAre(graph_output));
43 EXPECT_THAT(graph.FindInputs(node->id), UnorderedElementsAre(graph_input));
44 EXPECT_THAT(graph.FindOutputs(node->id), UnorderedElementsAre(graph_output));
45 EXPECT_THAT(graph.FindConsumers(graph_input->id), UnorderedElementsAre(node));
46 EXPECT_THAT(graph.FindProducer(graph_output->id), ::testing::Eq(node));
47 EXPECT_THAT(graph.FindConsumers(graph_output->id), UnorderedElementsAre());
48 EXPECT_THAT(graph.FindProducer(graph_input->id), ::testing::Eq(nullptr));
49}
50
51TEST(Model, SingleNodeMultipleOutputs) {
52 // graph_input -> node -> (graph_output1, graph_output2)

Callers

nothing calls this directly

Calls 15

NewValueMethod · 0.80
AddConsumerMethod · 0.80
FindInputsMethod · 0.80
FindOutputsMethod · 0.80
FindConsumersMethod · 0.80
FindProducerMethod · 0.80
RemoveConsumerMethod · 0.80
RemoveProducerMethod · 0.80
DeleteValueMethod · 0.80
DeleteNodeMethod · 0.80
EqFunction · 0.50

Tested by

no test coverage detected