Args: df (DataFlow): the DataFlow to serialize. path (str): output npz file.
(df, path)
| 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): |
nothing calls this directly
no test coverage detected