Improvements to function._FuncGraph.
authorSkye Wanderman-Milne <skyewm@google.com>
Thu, 17 May 2018 16:28:35 +0000 (09:28 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 17 May 2018 16:33:29 +0000 (09:33 -0700)
commit00ee6689bb838f45a393d4fbca11ad10018a382a
tree0ff74b4611d1cefee87059c9efb0c79621ca2d34
parent50f38071ec0a2502e9d34dd955d7d3715d3b4856
Improvements to function._FuncGraph.

* Adds 'inputs', 'outputs', and 'name' field to _FuncGraph. This
  allows _FuncGraph to encapsulate all the information needed to
  convert it to a FunctionDef.
* Refactor logic for converting a Python callable to a _FuncGraph into
  a new method, func_graph_from_py_func().

These changes are in preparation for converting tf.cond to emit an If
op. By exposing _FuncGraph functionality outside of _DefinedFunction,
_FuncGraphs can be used to represent functions that are manipulated
(e.g. to output intermediate tensors) before being converted to
FunctionDef protos.

PiperOrigin-RevId: 197003496
tensorflow/python/framework/function.py