Solved by ptrblck in post #2 
              
              
                Your Python code is wrong, as you are creating a new .weights attribute while you would like to replace the .weight parameter. 
Change it to: 
x_kernel = torch.randn(3, 3)
rgb_image = torch.randn(1, 3, 24, 24)

conv = torch.nn.Conv2d(in_channels=3, out_channels=3, groups=1, kernel_size= (3,3), paddi…