save model
(obj, filepath: str, **kwargs)
| 51 | |
| 52 | # checkpointer from fex. Save to hdfs |
| 53 | def save(obj, filepath: str, **kwargs): |
| 54 | """ save model """ |
| 55 | if filepath.startswith("hdfs://"): |
| 56 | with hopen(filepath, "wb") as writer: |
| 57 | torch.save(obj, writer, **kwargs) |
| 58 | else: |
| 59 | torch.save(obj, filepath, **kwargs) |
| 60 | |
| 61 | |
| 62 | def save_checkpoint(output_dir: str, |
no test coverage detected