操作:我有维度[n x m x c]的pytorch张量A和维度[1 x 1 x c]的B。我想将每个1 x 1 x c向量的内积与A的B相乘,从而生成[n x m]维的张量C。在我的网络的前向函数中,在特定的步骤我接收维度[N, channels, Height, Width]的张量,其中N是图像的数量,通道是特征映射中的通道的数量,高度和宽度是当前特征映射的。有人能解释一下pytorch中实现这
如何将张量重塑成占位符的形状?a = tf.placeholder(shape=[None, None, 48])b = tf.reshape(a, shape=[-1, 4, 4, 3]) #flatten the first two dimension and expand the last dimensionc = tf.reshape(b, shape=[h, w, 3]) # reshape