2016-12-23 9 views
1

Aを使用テンソルからサブテンソルを取得するには、私はA次のindixesから新しいテンソルを取得したい形状(2261,)TensorFlow:インデックス

tensorflow.tensorです:[10,20,30]

私はすべて以下のことを試してみました何もできません:

A[[10,20,30]] 
# *** ValueError: Index out of range using input dim 1; input has only 1 dims for 'strided_slice' (op: 'StridedSlice') with input shapes: [2261], [3], [3], [3]. 

A[10,20,30] 
# same error as above 

A[numpy.array([10,20,30])] 
# *** ValueError: Shape must be rank 1 but is rank 2 for 'strided_slice' (op: 'StridedSlice') with input shapes: [2261], [1,3], [1,3], [1]. 

A[10] 
# <tf.Tensor 'strided_slice:0' shape=() dtype=float32> - not an error but a shapeless tensor 

A[tensorflow.constant(10)] 
# same problem as above 

なぜこれらは機能しません。どうすればよいですか?

答えて

0

TensorFlowではまだファンシーなインデックス作成はサポートされていません。アップデートのためにhttps://github.com/tensorflow/tensorflow/issues/206を見守ってください(おそらく他の場所もあります)。

であることを確認するには、__tensor.__getitem__に関するドキュメントがあるようです。参考のため

関連する問題