Unfortunately I don’t know how to resolve this issue as I’m not familiar with your code, but the error is most likely raised by the view_as operation, which tries to view the parameter in an invalid shape.
You should thus either fix the slicing operation on weights or the conv_layer.weight shape.