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

ResourceVariables shouldn't need twice the memory when initializing.

This is safe because all ops which write to resource variables check whether
there are other outstanding references to the buffer and copy if that's the
case. So we can safely reuse the buffer of initializer tensors even in weird
cases such as initializing from a constant (which should never be mutated)
or using the same tensor to initialize multiple variables.

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