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

Function ExecuteFlexOp

tensorflow/lite/delegates/flex/kernel.cc:335–359  ·  view source on GitHub ↗

Executes the TensorFlow op given by 'op_name', with the attributes specified in 'nodedef'. Inputs and outputs are given as indices into the 'buffer_map'.

Source from the content-addressed store, hash-verified

333// Executes the TensorFlow op given by 'op_name', with the attributes specified
334// in 'nodedef'. Inputs and outputs are given as indices into the 'buffer_map'.
335tensorflow::Status ExecuteFlexOp(TfLiteContext* context, BufferMap* buffer_map,
336 OpNode* node_data) {
337 TF_RETURN_WITH_CONTEXT_IF_ERROR(node_data->BuildEagerInputs(buffer_map),
338 " (while executing '", node_data->name(),
339 "' via Eager)");
340
341 node_data->mutable_outputs()->ResetTensorHandles();
342 int num_retvals = node_data->NumOutputs();
343 TF_RETURN_WITH_CONTEXT_IF_ERROR(
344 EagerExecute(node_data->op(),
345 node_data->mutable_outputs()->GetTensorHandles(),
346 &num_retvals),
347 " (while executing '", node_data->name(), "' via Eager)");
348
349 if (num_retvals != node_data->NumOutputs()) {
350 return tensorflow::errors::Internal(
351 "Unexpected number of outputs from EagerExecute");
352 }
353
354 TF_RETURN_IF_ERROR(node_data->PersistEagerOutputs(buffer_map));
355
356 node_data->ClearEagerInputs();
357
358 return tensorflow::Status::OK();
359}
360
361// The larger 'op', which contains all the nodes in a supported subgraph.
362struct OpData {

Callers 1

EvalFunction · 0.85

Calls 11

EagerExecuteFunction · 0.85
InternalFunction · 0.85
BuildEagerInputsMethod · 0.80
ResetTensorHandlesMethod · 0.80
mutable_outputsMethod · 0.80
GetTensorHandlesMethod · 0.80
PersistEagerOutputsMethod · 0.80
ClearEagerInputsMethod · 0.80
nameMethod · 0.65
NumOutputsMethod · 0.45
opMethod · 0.45

Tested by

no test coverage detected