Make it possible to wrap Layer's `call` method in `tfe.defun`.
This change:
(1) wraps Layer's `build` method in an `init_scope`, which in turn makes it
possible to compile the `call` method into a graph function by wrapping
it in `tfe.defun` because the `init_scope` lifts all ops created in
`build` out of function-building graphs;
(2) defers the creation of regularizers, constructing them after `build`
exits and thereby ensuring that they are not created inside an
`init_scope`.
PiperOrigin-RevId: 180954866
Loading
Please sign in to comment