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

Method OkOpRegistration

tensorflow/lite/interpreter_test.cc:1935–1951  ·  view source on GitHub ↗

Build the kernel registration for an op that returns kTfLiteOk.

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 2

TfLiteIntArrayCopyFunction · 0.85
ResizeTensorMethod · 0.80

Tested by

no test coverage detected