You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My machine has a Titan X card so I would like to use the memory as efficient as possible to avoid expensive data transfer between the CPU and GPU. Therefore, I want to have as many images as possible (let's say 5 GB) on the GPU memory inside a tf.Variable or tf.constant. However, I also want to update these data tensors after a number of iterations (e.g. a replay memory). For training, I then only need to send sample indices to the GPU and use tf.slice to generate a training batch.
My question is what the correct way is to update specific elements in an existing tf.Variable? I already found methods using tf.scatter_update and tf.slice:
Some of this is covered #206. For single variables and unordered sets of elements tf.scatter_update is the right thing, and #206 proposes tf.assign_slice_* which cover what you want. Our hope is to make most of these available with something like x[i].assign(...), but there are a few steps before we get there.
If your satisfied with #206 I'll close as duplicate, but let me know if not!
Hi Geoffrey, thanks for your reply. I am satisfied with the conversation and proposed solutions in #206. You can close this one. Hopefully the assign operations will arrive soon!
My machine has a Titan X card so I would like to use the memory as efficient as possible to avoid expensive data transfer between the CPU and GPU. Therefore, I want to have as many images as possible (let's say 5 GB) on the GPU memory inside a
tf.Variable
ortf.constant
. However, I also want to update these data tensors after a number of iterations (e.g. a replay memory). For training, I then only need to send sample indices to the GPU and usetf.slice
to generate a training batch.My question is what the correct way is to update specific elements in an existing
tf.Variable
? I already found methods usingtf.scatter_update
andtf.slice
:http://stackoverflow.com/questions/34685947/adjust-single-value-within-tensor-tensorflow
http://stackoverflow.com/questions/37593960/set-k-largest-elements-of-a-tensor-to-zero-in-tensorflow
But these methods seem cumbersome and tricky. Are there better ways of updating existing variables?
The text was updated successfully, but these errors were encountered: