Hi.
I want to know is there any efficient way to convert Python objects of various types to Tensor objects,like convert_to_tensor in tensorflow, It accepts Tensor objects, numpy arrays, Python lists, and Python scalars.
Although I know that I can determine the type of data and then call the corresponding API, but I think this is too bloated, and I don’t want to write a bunch of ‘if judgment statements’ to determine the type of data, so I would like to ask if there is a corresponding pytorch API or is there any efficient way
Appreciate for any replies.