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

Method SetUp

tensorflow/lite/interpreter_test.cc:1123–1143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1121class TestDelegate : public ::testing::Test {
1122 protected:
1123 void SetUp() override {
1124 interpreter_.reset(new Interpreter);
1125 interpreter_->AddTensors(5);
1126 interpreter_->SetInputs({0, 1});
1127 interpreter_->SetOutputs({3, 4});
1128 TfLiteQuantizationParams quant;
1129 interpreter_->SetTensorParametersReadWrite(0, kTfLiteFloat32, "", {3},
1130 quant);
1131 interpreter_->SetTensorParametersReadWrite(1, kTfLiteFloat32, "", {3},
1132 quant);
1133 interpreter_->SetTensorParametersReadWrite(2, kTfLiteFloat32, "", {3},
1134 quant);
1135 interpreter_->SetTensorParametersReadWrite(3, kTfLiteFloat32, "", {3},
1136 quant);
1137 interpreter_->SetTensorParametersReadWrite(4, kTfLiteFloat32, "", {3},
1138 quant);
1139 TfLiteRegistration reg = AddOpRegistration();
1140 interpreter_->AddNodeWithParameters({0, 0}, {2}, nullptr, 0, nullptr, &reg);
1141 interpreter_->AddNodeWithParameters({1, 1}, {3}, nullptr, 0, nullptr, &reg);
1142 interpreter_->AddNodeWithParameters({2, 1}, {4}, nullptr, 0, nullptr, &reg);
1143 }
1144
1145 void TearDown() override {
1146 // Interpreter relies on delegate to free the resources properly. Thus

Callers

nothing calls this directly

Calls 7

AddOpRegistrationFunction · 0.85
resetMethod · 0.45
AddTensorsMethod · 0.45
SetInputsMethod · 0.45
SetOutputsMethod · 0.45
AddNodeWithParametersMethod · 0.45

Tested by

no test coverage detected