tf.boolean_mask(tensor, mask, name, axis)

1D-tensor
2D-tensor