Fix NumPy scalar arrays to tensor conversion (#97696)
By performing cast from scalar to 0-dim array only if object is not an
array already.
Fixes https://github.com/pytorch/pytorch/issues/97021
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97696
Approved by: https://github.com/albanD