Build the kernel registration for an op that returns kTfLiteOk.
| 1933 | |
| 1934 | // Build the kernel registration for an op that returns kTfLiteOk. |
| 1935 | TfLiteRegistration OkOpRegistration() { |
| 1936 | TfLiteRegistration reg = {nullptr, nullptr, nullptr, nullptr}; |
| 1937 | |
| 1938 | // Set output size to the input size in OkOp::Prepare(). Code exists to have |
| 1939 | // a framework in Prepare. The input and output tensors are not used. |
| 1940 | reg.prepare = [](TfLiteContext* context, TfLiteNode* node) { |
| 1941 | TfLiteTensor* in_tensor = &context->tensors[node->inputs->data[0]]; |
| 1942 | TfLiteTensor* out_tensor = &context->tensors[node->outputs->data[0]]; |
| 1943 | TfLiteIntArray* new_size = TfLiteIntArrayCopy(in_tensor->dims); |
| 1944 | return context->ResizeTensor(context, out_tensor, new_size); |
| 1945 | }; |
| 1946 | |
| 1947 | reg.invoke = [](TfLiteContext* context, TfLiteNode* node) { |
| 1948 | return kTfLiteOk; |
| 1949 | }; |
| 1950 | return reg; |
| 1951 | } |
| 1952 | |
| 1953 | void SetUp() final { |
| 1954 | cancellation_data_.is_cancelled = false; |
nothing calls this directly
no test coverage detected