Commit dae9cabb authored by Benjamin Kramer's avatar Benjamin Kramer Committed by TensorFlower Gardener
Browse files

[XLA:AOT] Add support for resource variables as inputs/outputs

This is what I think is the minimum viable solution and also serves as an RFC
for the direction in which this API should evolve.

With this change resource variables behave exactly the same way as regular
input/outputs, any variable gets translated into a pair of argument/result
accessors. Initial values coming from the graph are ignored, the user has to
supply their own instead.

For the configuration this requires specifying name/shape/type for all
variables used in the model. I tried to infer the shape from the graph but it's
rather annoying because the arguments are create very early in the process.

This is intentionally lacking documentation, setting the API in stone now seems
too early. It's unclear to me whether we want to keep the argument/result
matching long-term or switch to something that supports in-place updates. The
current API cannot do that because it would violate const correctness.

PiperOrigin-RevId: 233042296
parent 34c4e686
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment