Fix `asarray` doc examples. (#100971)
Fixes issue raised on [PyTorch discuss](https://discuss.pytorch.org/t/confused-on-an-example-on-pytorch-official-documentation/178785).
**Summary:** the examples in `asarray` docs have a few mistakes that makes it not work. This PR fixes those.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/100971
Approved by: https://github.com/Skylion007, https://github.com/lezcano