Commit 5802096c authored by Akshay Agrawal's avatar Akshay Agrawal Committed by TensorFlower Gardener
Browse files

Refactor TensorArray to avoid copies and memory allocations when executing eagerly.

With this change, writes to TensorArrays when eager execution is enabled take O(1) time instead of O(n). Additionally, whereas writing to a TensorArray when constructing a graph results in allocating a new Python TensorArray object, writing to a TensorArray with eager enabled no longer performs that allocation (graph construction uses these allocations to ensure correctness of control flow and gradients, but this isn't necessary when executing eagerly). Finally, this change also removes the artificial write-once semantics of TensorArrays when executing eagerly.

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