Hello,
Please read the two implementations, which one is preferred for GPU?
general question: should I send scalar to GPU ?
class Net1(nn.Module):
    def __init__(self):
        super().__init__()
        self.register_buffer('tau', torch.tensor(0.5))
        
    def forward(self, x):
        return self.tau*x
#------------------------------------------------------------------
class Net2(nn.Module):
    def __init__(self):
        super().__init__()
        self.tau=0.5
        
    def forward(self, x):
        return self.tau*x
#------------------------------------------------------------------
model=Net1()
model.to('cuda')
#or
model=Net2()
model.to('cuda')
# will self.tau be sent to GPU 'automatically' and then do tau*x ?