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

Method SetUp

tensorflow/lite/interpreter_test.cc:1026–1047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1024 }
1025
1026 void SetUp() final {
1027 // Add two inputs and two outputs that don't depend on each other
1028 ASSERT_EQ(interpreter_.AddTensors(4), kTfLiteOk);
1029 interpreter_.SetInputs({0, 1});
1030 interpreter_.SetOutputs({2, 3});
1031 TfLiteQuantizationParams quantized;
1032 for (int tensor_index = 0; tensor_index < 4; tensor_index++) {
1033 ASSERT_EQ(interpreter_.SetTensorParametersReadWrite(
1034 tensor_index, kTfLiteFloat32, "", {3}, quantized),
1035 kTfLiteOk);
1036 }
1037
1038 // Define two copy functions that also use the user_data to report that
1039 // they were called.
1040 // i.e. tensor[2] = copy(tensor[0]); tensor[3] = copy(tensor[1]);
1041 // thus we can reorder the two nodes arbitrary and still satisfy dependency
1042 // order.
1043 MakeCopyNode(0, 2);
1044 MakeCopyNode(1, 3);
1045
1046 ASSERT_EQ(interpreter_.AllocateTensors(), kTfLiteOk);
1047 }
1048
1049 protected:
1050 Interpreter interpreter_;

Callers

nothing calls this directly

Calls 5

AddTensorsMethod · 0.45
SetInputsMethod · 0.45
SetOutputsMethod · 0.45
AllocateTensorsMethod · 0.45

Tested by

no test coverage detected