TensorFlow - numpy-like tensor indexing

后端 未结 3 1550
猫巷女王i
猫巷女王i 2020-11-30 03:24

In numpy, we can do this:

x = np.random.random((10,10))
a = np.random.randint(0,10,5)
b = np.random.randint(0,10,5)
x[         


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 03:52

    For Tensorflow 0.11, basic indexing has been implemented. More advanced indexing (like boolean indexing) is still missing but apparently is planned for future versions.

    Advanced indexing can be tracked with https://github.com/tensorflow/tensorflow/issues/4638

提交回复
热议问题