Commit 85fb2bf5 authored by Skye Wanderman-Milne's avatar Skye Wanderman-Milne Committed by TensorFlower Gardener
Browse files

Introduce eager.function.FuncGraph class.

FuncGraph is a subclass of CapturingGraph, and represents a function
body.  This is similar to _FuncGraph in framework/function.py. The
eventual goal is to completely replicate the functionality, both for
use in tfe.defun and cond_v2.

As a PoC, FuncGraph is used instead of CapturingGraph in
_trace_and_define_function. The existing unit tests provide coverage
for it.

As part of this change, CapturingGraph.captures is also changed from a
dict to an OrderedDict. The order determines in what order the
captured inputs should be passed to the final function (as well as
simplifies some of the logic, since we no longer have to key by tensor
ID and manually sort to get deterministic results).

PiperOrigin-RevId: 207926299
parent 42b61fbd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment