Skip to content Skip to sidebar Skip to footer

Removing Or Masking The I'th Sub-element Of A Tilted Tensor?

I am searching for a way using Tensorflow to extract all of the sub-elements except for the one corresponding to the tensor's index. (eg. if looking at index 1 then only sub-elemen

Solution 1:

Turns out Tensorflow had exactly what I was looking for already built in :)

result = tf.boolean_mask(tile, mask)
result = tf.reshape(result,  [n, n-1, -1])

>>> print(result)
[[[ 2.  7.  0.]
  [ 3.  7.  0.]]

 [[ 1.  7.  0.]
  [ 3.  7.  0.]]

 [[ 1.  7.  0.]
  [ 2.  7.  0.]]]

Post a Comment for "Removing Or Masking The I'th Sub-element Of A Tilted Tensor?"