MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / save_raw

Function save_raw

tests/dump_phase6_reference.py:44–49  ·  view source on GitHub ↗
(path: str, arr: np.ndarray, shape)

Source from the content-addressed store, hash-verified

42
43
44def save_raw(path: str, arr: np.ndarray, shape) -> None:
45 os.makedirs(os.path.dirname(path) or ".", exist_ok=True)
46 with open(path + ".bin", "wb") as f:
47 f.write(arr.astype(np.float32, copy=False).tobytes())
48 with open(path + ".shape", "w", encoding="utf-8") as f:
49 f.write(",".join(str(int(d)) for d in shape))
50
51
52def save_ggml_bd(path: str, x_bd: torch.Tensor) -> None:

Callers 4

save_ggml_bdFunction · 0.70
save_ggml_bndFunction · 0.70
save_ggml_bhwcFunction · 0.70
save_ggml_whcb_from_nchwFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected