as the title. so is there any difference between the function with and without ‘_’?
Operations ending with _ are in-place. From the 60 minute blitz tutorial:
Any operation that mutates a tensor in-place is post-fixed with an _. For example:
x.copy_(y)
,x.t_()
, will changex
.
got it, thank you very much