How to assgin element value according to its index in tensorflow? -


for in range shape(l)[0]:     l[i,:,:,:,0] = j in range shape(l)[2]:     l[:,:,j,:,1] = j 

for example, if want implement piece of code above:

(actually, tend use tf.gather therefore need create index)

what type of l? if it's tensor have pass through tf.py_func function (i think it's best option since allow treat tensor object numpy.array , it's trivial) cf :

https://www.tensorflow.org/api_docs/python/tf/py_func

else seems complicated cf :

is scatter_update() placeholder in tensorflow


Comments

Popular posts from this blog

html - How to custom Bootstrap grid height? -

javascript - pass values from mssql to views in node -

javascript - Understanding ExtJS Framework Syntax -