Implement Python Array API `asarray` function. (#60627)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60627
In this PR, the core of `frombuffer` and `fromDLPack` onto _tensor_new.cpp_. `asarray`
uses such refactored functions for interpreting the object as a tensor. We follow the
Python Array API standard found:
https://data-apis.org/array-api/latest/API_specification/creation_functions.html?highlight=asarray
Test Plan: Imported from OSS
Reviewed By: H-Huang
Differential Revision: D31640510
Pulled By: mruberry
fbshipit-source-id: d0869e0d73cb50023d5866b001dac5d34ca30dfd