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

Function load_tensor

tests/dump_cpp_preprocessed.py:33–37  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

31 return chw
32
33def load_tensor(path):
34 with open(path + ".shape") as f:
35 shape = [int(x) for x in f.read().strip().split(",") if x]
36 data = np.fromfile(path + ".bin", dtype=np.float32)
37 return data.reshape(shape)
38
39if __name__ == "__main__":
40 ref_dir = sys.argv[1] if len(sys.argv) > 1 else "tests/ref_phase3"

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected