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

Function save_raw

tests/dump_geom_encoder_reference.py:41–46  ·  view source on GitHub ↗
(path: str, arr: np.ndarray, shape)

Source from the content-addressed store, hash-verified

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

Callers 5

save_ggml_bndFunction · 0.70
save_ggml_sbdFunction · 0.70
save_ggml_nchwFunction · 0.70
save_ggml_1dFunction · 0.70
dump_geometry_encoderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected