Create tensor from Numpy in current device. (#105546)
Fix: #105046
This PR changes how tensors are created from Numpy arrays, when tracing with
dynamo. Instead of using `from_numpy`, we use `as_tensor`. The latter takes into
consideration the current device.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105546
Approved by: https://github.com/lezcano