How to 4D tensor dot product?

torch.dot(nn.Conv2d(3, 64, kernel_size=(3,1), stride=1, padding=(0,1)).weight, nn.Conv2d(3, 64, kernel_size=(1,3), stride=1, padding=(0,1)).weight)

RuntimeError: dot: Expected 1-D argument self, but got 4-D

Like this, I want to make 3x3 filter and apply it to train.
How should I do?

Thank you.

The dot product will return a scalar value, so maybe you would like to apply torch.matmul on the filter kernels?

1 Like