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

Method MakeCopyNode

tensorflow/lite/interpreter_test.cc:1012–1024  ·  view source on GitHub ↗

Adds a copy node going from tensor `input` to output tensor `output`. Note, input is used as the node_id. Inject run_order as op accessible data. Note: this is a little strange of a way to do this, but it is using op functionality to avoid static global variables.

Source from the content-addressed store, hash-verified

1010 // data. Note: this is a little strange of a way to do this, but it is
1011 // using op functionality to avoid static global variables.
1012 void MakeCopyNode(int input, int output) {
1013 // Ownership of call_reporting is taken by interpreter (malloc is used due
1014 // to nodes being a C99 interface so free() is used).
1015 TfLiteRegistration copy_op = CopyOpRegistration();
1016 CallReporting* call_reporting_1 =
1017 reinterpret_cast<CallReporting*>(malloc(sizeof(CallReporting)));
1018 new (call_reporting_1) CallReporting(input, &run_order_);
1019 ASSERT_EQ(interpreter_.AddNodeWithParameters(
1020 {0}, {2}, nullptr, 0,
1021 reinterpret_cast<void*>(call_reporting_1), &copy_op),
1022 kTfLiteOk);
1023 ASSERT_EQ(interpreter_.ResizeInputTensor(input, {3}), kTfLiteOk);
1024 }
1025
1026 void SetUp() final {
1027 // Add two inputs and two outputs that don't depend on each other

Callers

nothing calls this directly

Calls 2

AddNodeWithParametersMethod · 0.45
ResizeInputTensorMethod · 0.45

Tested by

no test coverage detected