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
Loading
Please sign in to comment