pygmtools.utils.from_numpy

pygmtools.utils.from_numpy(input, 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

  • backend – (default: pygmtools.BACKEND variable) the backend for computation.

Returns

tensor for the backend