我有一个占位符供输入:
Y = tf.placeholder(dtype=tf.float32, shape=(None, n_outputs))
Run Code Online (Sandbox Code Playgroud)
现在,我想创建一个与Y形状相同的常量:
w = Y.get_shape()
zero = tf.constant(np.zeros(w), dtype=tf.float32)
Run Code Online (Sandbox Code Playgroud)
错误返回:
__index__ returned non-int (type NoneType)
Run Code Online (Sandbox Code Playgroud)