操作:我有维度[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是图像的<
假设,我有一个三维张量Aprint(A)mask = torch.zeros((4, 3), dtypetorch.ByteTensormask[1, 1] = 1print('Mask: ', mask)
从masked_select中使用PyTorchRuntimeError: The size of tensor a (2) must m