【发布时间】:2018-05-25 12:31:36
【问题描述】:
我的部分代码如下:
class_label = tf.placeholder(tf.float32, [None], name="condition_checking")
row_index = tf.where(class_label > 0)
我想检查row_index什么时候为空写如下
loss_f_G_filtered = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(
logits=y1_filterred, labels=y__filtered), name="filtered_reg")
if row_index == []:
loss_f_G_filtered = tf.constant(0, tf.float32)
但是,我不知道如何检查row_index 是否为空张量。
【问题讨论】:
标签: tensorflow tensor