How implement mutiply between a parameter and conv2d leayer?

image
in this picture, v0 is the random initial tensor parameter with requir_grad, how implement mutiply between v0 and conv(1x1)?

Something like this
if v0 is a 1x K vector and conv is a a NxMxK you can rearrange conv into a (NxM)xK vector and perform matrix multiuplication

    def multiply(v0,conv):
        N,M,K = conv.size()
        conv = conv.view(N*M,K)
        return torch.mm(conv,v0.unsqueeze(0)).view(N,M,K)

if v0 is a 1x1 vector requires_grad, how? looks like you implement mutiply between v0 and conv2d’s output , I want to (v0 x conv2d layer) implement in pytorch, it could not an torch.tensor x layer module