Coming from C++ I am used to the fact that the syntax
def foo(x):
  change x ...

copies the argument that is passed on the call site into the local variable x.
However in Pytorch I believe that reference semantics implicitly cause any value that is assigned on the call site to be modified as well when x is changed inside the function.
Is that true? or does this only hold for numpy/pytorch etc.?
and if so, does this render return values vastly obsolete?