Strain Gauge with Tensor
I am trying to use the "advanced", numpy style that was added to this PR , however I am facing the same problem as the user here :
ValueError: Shape must be rank 1 but is rank 2 for 'strided_slice_15' (op: 'StridedSlice') with input shapes: [3,2], [1,2], [1,2], [1].
Namely, I would like to do the equivalent of this numpy operation (works in numpy):
A = np.array([[1,2],[3,4],[5,6]]) id_rows = np.array([0,2]) A[id_rows]
however this doesn't work in TF for the error above:
A = tf.constant([[1,2],[3,4],[5,6]]) id_rows = tf.constant([0,2]) A[id_rows]
+3
source to share
2 answers