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