Commit e1fb7a24 authored by Alexandre Passos's avatar Alexandre Passos Committed by TensorFlower Gardener
Browse files

Makes Variable an abstract base class with a factory-constructing metaclass.

The metaclass, when asked to make instances of Variable, will loop over a
scope of creator functions calling them, before finally bottoming out on
a function which constructs a subclass of Variable, which goes through
the normal route.

This allows us to split Variable from RefVariable and to, in a follow-up CL,
add a use_resource argument to the Variable constructor so it can also return
ResourceVariable.

This is the minimal change to get things working; it does not expose the
creator stack or add the use_resource argument.

PiperOrigin-RevId: 204910138
parent 2bdc5f12
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment