TensorFlow中获取大于零的元素集合

a为tensor

idx = tf.where(a > 0)

output = tf.gather_nd(a, idx)

猜你喜欢

转载自blog.csdn.net/HY_JT/article/details/81633910