Commit dbb0feec authored by Akshay Agrawal's avatar Akshay Agrawal Committed by TensorFlower Gardener
Browse files

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
parent 9878a2e6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment