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

Function TEST_F

tensorflow/lite/kernels/variable_ops_test.cc:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75};
76
77TEST_F(VariableOpsTest, TestAssignThenReadVariable) {
78 ASSERT_EQ(interpreter_.AllocateTensors(), kTfLiteOk);
79 TfLiteTensor* input_assign_index = interpreter_.tensor(0);
80 input_assign_index->data.i32[0] = 1;
81 TfLiteTensor* input_read_index = interpreter_.tensor(1);
82 input_read_index->data.i32[0] = 1;
83 TfLiteTensor* input_data_index = interpreter_.tensor(2);
84 input_data_index->data.f[0] = 1717;
85 ASSERT_EQ(interpreter_.Invoke(), kTfLiteOk);
86
87 // Verify output.
88 TfLiteTensor* output = interpreter_.tensor(3);
89 ASSERT_EQ(output->dims->size, 0);
90 EXPECT_EQ(output->data.f[0], 1717);
91}
92
93TEST_F(VariableOpsTest, TestReadVariableBeforeAssign) {
94 ASSERT_EQ(interpreter_.AllocateTensors(), kTfLiteOk);

Callers

nothing calls this directly

Calls 4

AllocateTensorsMethod · 0.45
tensorMethod · 0.45
InvokeMethod · 0.45
ResizeInputTensorMethod · 0.45

Tested by

no test coverage detected