MCPcopy Create free account
hub / github.com/PythonOT/POT / _from_numpy

Method _from_numpy

ot/backend.py:282–284  ·  view source on GitHub ↗

Creates a tensor cloning a numpy array, with the given precision (defaulting to input's precision) and the given device (in case of GPUs)

(self, a, type_as=None)

Source from the content-addressed store, hash-verified

280
281 # convert an array from numpy
282 def _from_numpy(self, a, type_as=None):
283 """Creates a tensor cloning a numpy array, with the given precision (defaulting to input's precision) and the given device (in case of GPUs)"""
284 raise NotImplementedError()
285
286 def set_gradients(self, val, inputs, grads):
287 """Define the gradients for the value val wrt the inputs"""

Callers 1

from_numpyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected