| 1951 | } |
| 1952 | |
| 1953 | void SetUp() final { |
| 1954 | cancellation_data_.is_cancelled = false; |
| 1955 | |
| 1956 | // Set up the interpreter. Create the input and output tensors. |
| 1957 | int num_tensors = 3; |
| 1958 | ASSERT_EQ(interpreter_.AddTensors(num_tensors), kTfLiteOk); |
| 1959 | interpreter_.SetInputs({0}); |
| 1960 | interpreter_.SetOutputs({2}); |
| 1961 | TfLiteQuantizationParams quantized; |
| 1962 | for (int tensor_index = 0; tensor_index < num_tensors; tensor_index++) { |
| 1963 | ASSERT_EQ(interpreter_.SetTensorParametersReadWrite( |
| 1964 | tensor_index, kTfLiteFloat32, "", {3}, quantized), |
| 1965 | kTfLiteOk); |
| 1966 | } |
| 1967 | interpreter_.SetCancellationFunction(&cancellation_data_, |
| 1968 | &CheckCancellation); |
| 1969 | } |
| 1970 | }; |
| 1971 | |
| 1972 | TEST_F(CancellationTest, CancelBeforeInvoke) { |
nothing calls this directly
no test coverage detected