I think u don’t have to manually set weight to cuda if the input of the argument weight  is something already in cuda.
U don’t have to inherit _ConvNd, u can just inherit nn.Module or just write it as an ordinary Python function.
I think ur code should work, and I’m not from  Pytorch team  .