Fix NumPy scalar arrays to tensor conversion (#97696) (#99732)
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
(cherry picked from commit b756fd98bb0acd10827a8efb4972e5a326a3d966)