0
M = tf.concat([tensor]*N, axix = 0)
但现在什么,N是一个张量,在运行时决定。
other_tensor = tf.placeholder(dtype=tf.int32, shape=[None, 2])
N = tf.shape(other_tensor)[0] # N is None, and it is decided in run time.
那么,该怎么做?
感谢您回答。也许我没有说清楚。在我的情况下,a = tf.placeholder(dtype = tf.int32,shape = [None,2]) –
@ZehaoShi看着你以前的问题,答案是'不,它根本不清楚'。要回答您的后续问题,请转至get_shape链接,查看动态形状的情况。 –
我使用tf.shape()获取动态形状。 tf.tile()正是我想要的。非常感谢你。为了方便他人,我现在正在重写这个问题。 –