diff options
author | Benoit Steiner <bsteiner@google.com> | 2018-01-10 14:39:49 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-01-10 14:44:25 -0800 |
commit | 69f231135304799f581d34df37d72cdc07fc8f58 (patch) | |
tree | 958bc6072aa705c89b695e4881f556847e1b3a9b /tensorflow/core/grappler/grappler_item_builder.h | |
parent | d4bfabc0cf744b890319d4612c2704e74fbc4eac (diff) |
Added a utility function to create a grappler item from a function definition
PiperOrigin-RevId: 181519635
Diffstat (limited to 'tensorflow/core/grappler/grappler_item_builder.h')
-rw-r--r-- | tensorflow/core/grappler/grappler_item_builder.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/core/grappler/grappler_item_builder.h b/tensorflow/core/grappler/grappler_item_builder.h index 85151aabea..fa6f9faa09 100644 --- a/tensorflow/core/grappler/grappler_item_builder.h +++ b/tensorflow/core/grappler/grappler_item_builder.h @@ -19,6 +19,7 @@ limitations under the License. #include <memory> #include <set> #include <string> +#include "tensorflow/core/framework/attr_value.pb.h" #include "tensorflow/core/grappler/grappler_item.h" namespace tensorflow { @@ -57,6 +58,12 @@ struct ItemConfig { std::unique_ptr<GrapplerItem> GrapplerItemFromMetaGraphDef( const string& id, const MetaGraphDef& meta_graph, const ItemConfig& cfg); +// Factory method for creating a GrapplerItem from a FunctionDef. +// Returns nullptr if the given function def cannot be converted. +std::unique_ptr<GrapplerItem> GrapplerItemFromFunctionDef( + const string& id, const FunctionDef& func, + const std::unordered_map<string, AttrValue>& func_attr); + } // end namespace grappler } // end namespace tensorflow |