diff options
author | 2018-08-24 17:35:05 -0700 | |
---|---|---|
committer | 2018-08-24 17:39:39 -0700 | |
commit | b42c222b19cde1a8a72fdd81c483bd5a2b1f674e (patch) | |
tree | b2df2d22518edccc592fde34132b4022077ac111 /tensorflow/contrib/lite/delegates | |
parent | 35242953bea84ab4bde793ad8bb6e704ffbf092f (diff) |
Internal change.
PiperOrigin-RevId: 210184689
Diffstat (limited to 'tensorflow/contrib/lite/delegates')
-rw-r--r-- | tensorflow/contrib/lite/delegates/eager/BUILD | 1 | ||||
-rw-r--r-- | tensorflow/contrib/lite/delegates/eager/kernel.cc | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/delegates/eager/BUILD b/tensorflow/contrib/lite/delegates/eager/BUILD index 8abc828578..88c70fbb8a 100644 --- a/tensorflow/contrib/lite/delegates/eager/BUILD +++ b/tensorflow/contrib/lite/delegates/eager/BUILD @@ -132,6 +132,7 @@ cc_library( ], "//conditions:default": [ "//tensorflow/core:protos_all_cc", + "//tensorflow/core:framework", ], }), ) diff --git a/tensorflow/contrib/lite/delegates/eager/kernel.cc b/tensorflow/contrib/lite/delegates/eager/kernel.cc index febf0b85a4..f8467c7cb2 100644 --- a/tensorflow/contrib/lite/delegates/eager/kernel.cc +++ b/tensorflow/contrib/lite/delegates/eager/kernel.cc @@ -26,6 +26,7 @@ limitations under the License. #include "tensorflow/core/common_runtime/eager/execute.h" #include "tensorflow/core/common_runtime/eager/tensor_handle.h" #include "tensorflow/core/framework/node_def.pb.h" +#include "tensorflow/core/framework/node_def_util.h" // Note: this is part of TF Lite's Eager delegation code which is to be // completed soon. @@ -189,6 +190,14 @@ void* Init(TfLiteContext* context, const char* buffer, size_t length) { } } + // Fill NodeDef with defaults if it's a valid op. + const tensorflow::OpRegistrationData* op_reg_data; + auto tf_status = tensorflow::OpRegistry::Global()->LookUp( + node_data.nodedef.op(), &op_reg_data); + if (tf_status.ok()) { + AddDefaultsToNodeDef(op_reg_data->op_def, &node_data.nodedef); + } + for (auto input_index : TfLiteIntArrayView(node->inputs)) { node_data.inputs.push_back(input_index); } |