Questions about cuda() and train()

I want to know when I pass model.cuda() or model.train() in paramters of function, do I have to re-assign cuda() or train() ?

def test():
     model = model.cuda()

def testB(model)
     Should I model.cuda() in here?
     model = model.train()

def testC(model)
     In here, we have to assign model = model.train() or model.cuda() ?

They modify in-place and return a reference to the original module. So you don’t need to, but you still can.