pygmtools.utils.from_numpy
- pygmtools.utils.from_numpy(input, device=None, backend=None)[source]
Convert a numpy ndarray to a tensor. This is the helper function to convert tensors across different backends via numpy.
- Parameters
input – input ndarray/
MultiMatchingResult
device – (default: None) the target device
backend – (default:
pygmtools.BACKEND
variable) the backend for computation.
- Returns
tensor for the backend