@ptrblck thx.
How to return a automatically converted tensor for :
class MyModule(nn.Module):
  
   def get(self):
       var1 = nn.Parameters()
       var2 = nn.register_buffer()
       return var1, var2  

when  the module MyModule run on cpu or gpu.