Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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()
336
def
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
preprocess
Function · 0.90
Calls
1
copy
Method · 0.45
Tested by
no test coverage detected