我经常看到使用符号“ None ”,“ -1 ”和“ ? ”来使程序动态定义张量的维数(例如批大小),似乎具有相同的效果:
x = tf.placeholder(tf.float32, [None, 48, 48, 3], name='InputData')
input = tf.reshape(input, [-1, input_size])
foo("bar", shape=(?,48), dtype=float32)
Run Code Online (Sandbox Code Playgroud)
使用这些符号中的任何一个是否与其他符号有功能上的区别?
谢谢