Hello,
First of all, if this is a duplicate I am deeply sorry. Could not find the reason behind this behavior of torch nn.Conv2d. The following code results in invalid combination of argument - got (Tensor, int, int, int)
Have you tried adding a .item() to the result of the torch.prod()? I guess the semantic to translate tensors with a single element is not the same as numpy array with a single element.
Unfortunately the result is the same with the following one,
test_layer = nn.Conv2d(in_channels=256, out_channels=T_times*(torch.prod( torch.tensor(T, dtype=torch.float) ).item()), kernel_size=1)
I have also tried doing the ops seperately just to make sure I do not have a silly mistake but the result is the same. I thought the scalar thing could be a solution for this:) It is not cumbersome to do it in numpy, but adding a package for just this operation requires a strong heart.
I would print exactly what you pass for each argument and make sure nothing is a Tensor Not sure which one it is at the moment, but a few prints in your code should make it clear.