MCPcopy Create free account
hub / github.com/imrahulr/hat / NumpyToTensor

Class NumpyToTensor

core/utils/utils.py:158–163  ·  view source on GitHub ↗

Transforms a numpy.ndarray to torch.Tensor.

Source from the content-addressed store, hash-verified

156
157
158class NumpyToTensor(object):
159 """
160 Transforms a numpy.ndarray to torch.Tensor.
161 """
162 def __call__(self, sample):
163 return torch.from_numpy(sample)

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…