res = tf.count_nonzero(tf.greater_equal(x, 0.))
# or using tf.greater() if you want to exclude 0.
Run Code Online (Sandbox Code Playgroud)
例子:
res = tf.count_nonzero(tf.greater_equal(x, 0.))
# or using tf.greater() if you want to exclude 0.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1745 次 |
| 最近记录: |