Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename save_* -> log_* #9

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## neptune-pytorch 1.1.0

### Fixes
- Rename `save_model` to `log_model` and `save_checkpoint` to `log_checkpoint`. (https://github.com/neptune-ai/neptune-pytorch/pull/9)

## neptune-pytorch 1.0.1

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions src/neptune_pytorch/impl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def hook(module, inp, output):
def base_namespace(self):
return self._base_namespace

def save_model(self, model_name: Optional[str] = None):
def log_model(self, model_name: Optional[str] = None):
if model_name is None:
# Default model name
model_name = "model.pt"
Expand All @@ -193,7 +193,7 @@ def save_model(self, model_name: Optional[str] = None):

safe_upload_model(self._namespace_handler["model"], model_name, self.model)

def save_checkpoint(self, checkpoint_name: Optional[str] = None):
def log_checkpoint(self, checkpoint_name: Optional[str] = None):
if checkpoint_name is None:
# Default checkpoint name
checkpoint_name = f"checkpoint_{self.ckpt_number}.pt"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def test_e2e(model, dataset):

run[npt_logger.base_namespace]["batch/loss"].append(loss.item())

npt_logger.save_checkpoint()
npt_logger.log_checkpoint()

# Save final model
npt_logger.save_model("model")
npt_logger.log_model("model")

run.wait()
run.exists(f"{npt_logger.base_namespace}/batch/loss")
Expand Down
Loading