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

Method ones

ot/backend.py:1565–1569  ·  view source on GitHub ↗
(self, shape, type_as=None)

Source from the content-addressed store, hash-verified

1563 return self._change_device(jnp.zeros(shape, dtype=type_as.dtype), type_as)
1564
1565 def ones(self, shape, type_as=None):
1566 if type_as is None:
1567 return jnp.ones(shape)
1568 else:
1569 return self._change_device(jnp.ones(shape, dtype=type_as.dtype), type_as)
1570
1571 def arange(self, stop, start=0, step=1, type_as=None):
1572 return jnp.arange(start, stop, step)

Callers

nothing calls this directly

Calls 2

_change_deviceMethod · 0.95
onesMethod · 0.45

Tested by

no test coverage detected