MCPcopy
hub / github.com/lllyasviel/Fooocus / numpy_to_pytorch

Function numpy_to_pytorch

modules/core.py:336–341  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

334@torch.no_grad()
335@torch.inference_mode()
336def numpy_to_pytorch(x):
337 y = x.astype(np.float32) / 255.0
338 y = y[None]
339 y = np.ascontiguousarray(y.copy())
340 y = torch.from_numpy(y).float()
341 return y

Callers 1

preprocessFunction · 0.90

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected