MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / load_npy_to_any

Function load_npy_to_any

tensorlayer/files/utils.py:2270–2290  ·  view source on GitHub ↗

Load `.npy` file. Parameters ------------ path : str Path to the file (optional). name : str File name. Examples --------- - see tl.files.save_any_to_npy()

(path='', name='file.npy')

Source from the content-addressed store, hash-verified

2268
2269
2270def load_npy_to_any(path='', name='file.npy'):
2271 """Load `.npy` file.
2272
2273 Parameters
2274 ------------
2275 path : str
2276 Path to the file (optional).
2277 name : str
2278 File name.
2279
2280 Examples
2281 ---------
2282 - see tl.files.save_any_to_npy()
2283
2284 """
2285 file_path = os.path.join(path, name)
2286 try:
2287 return np.load(file_path, allow_pickle=True).item()
2288 except Exception:
2289 return np.load(file_path, allow_pickle=True)
2290 raise Exception("[!] Fail to load %s" % file_path)
2291
2292
2293def file_exists(filepath):

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…