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'.
| 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'. |
| 335 | tensorflow::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. |
| 362 | struct OpData { |
no test coverage detected