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

Function load_tensor

tests/check_preprocessing.py:6–11  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

4import sys
5
6def load_tensor(path):
7 with open(path + ".shape") as f:
8 shape = [int(x) for x in f.read().strip().split(",")]
9 with open(path + ".bin", "rb") as f:
10 data = np.frombuffer(f.read(), dtype=np.float32).copy()
11 return data.reshape(shape)
12
13ref_dir = sys.argv[1] if len(sys.argv) > 1 else "tests/ref_phase3"
14

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected