我试图在层的部分连接的最后维度方面收集张量的切片.因为输出张量的形状是[batch_size, h, w, depth],我想根据最后一个维度选择切片,例如
[batch_size, h, w, depth]
# L is intermediate tensor partL = L[:, :, :, [0,2,3,8]]
但是,tf.gather(L, [0, 2,3,8])似乎只适用于第一个维度(对吧?)任何人都可以告诉我该怎么做?
tf.gather(L, [0, 2,3,8])
python deep-learning tensorflow
deep-learning ×1
python ×1
tensorflow ×1