Upon reading the documentation for the TensorArray class, I encountered this line:
If True, the TensorArray will be colocated on the same device as the Tensor used on its first write (write operations include write, unstack, and split). If False, the TensorArray will be placed on the device determined by the device context available during its initialization.
This makes me wonder whether only certain operations trigger actual memory allocation and reading/writing and if there is a list of those operations.
I would also like to know this as there are limitations due to OOM errors when creating tensors which are temporarily very large, but are processed in a batched manner anyways so the program is never required to actually hold all the data of the tensor - similar to how the dataset API allows processing infinitely large datasets as everything is loaded on demand.