MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / save

Method save

tensorpack/dataflow/serialize.py:130–142  ·  view source on GitHub ↗

Args: df (DataFlow): the DataFlow to serialize. path (str): output npz file.

(df, path)

Source from the content-addressed store, hash-verified

128
129 @staticmethod
130 def save(df, path):
131 """
132 Args:
133 df (DataFlow): the DataFlow to serialize.
134 path (str): output npz file.
135 """
136 buffer = []
137 size = _reset_df_and_get_size(df)
138 with get_tqdm(total=size) as pbar:
139 for dp in df:
140 buffer.append(dp)
141 pbar.update()
142 np.savez_compressed(path, buffer=np.asarray(buffer, dtype=np.object))
143
144 @staticmethod
145 def load(path, shuffle=True):

Callers

nothing calls this directly

Calls 4

_reset_df_and_get_sizeFunction · 0.85
get_tqdmFunction · 0.85
appendMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected