Skip to content

Commit

Permalink
Fix unused args
Browse files Browse the repository at this point in the history
  • Loading branch information
DubiousCactus committed May 31, 2024
1 parent 556fdaf commit b1c6c2e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/base_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(
train_loader (torch.utils.data.DataLoader): Training dataloader.
val_loader (torch.utils.data.DataLoader): Validation dataloader.
"""
_ = kwargs
self._run_name = run_name
self._model = model
assert model_ckpt_path is not None, "No model checkpoint path provided."
Expand All @@ -54,7 +55,9 @@ def _visualize(
batch: Union[Tuple, List, torch.Tensor],
epoch: int,
) -> None:
pass
_ = epoch
_ = batch
raise NotImplementedError("You must implement the _visualize method.")

@to_cuda
def _test_iteration(
Expand All @@ -79,6 +82,7 @@ def test(self, visualize_every: int = 0, **kwargs):
visualize_every (int, optional): Visualize the model predictions every n batches.
Defaults to 0 (no visualization).
"""
_ = kwargs
test_loss: MeanMetric = MeanMetric()
test_metrics: Dict[str, MeanMetric] = defaultdict(MeanMetric)
self._model.eval()
Expand Down
5 changes: 5 additions & 0 deletions src/base_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(
train_loader (torch.utils.data.DataLoader): Training dataloader.
val_loader (torch.utils.data.DataLoader): Validation dataloader.
"""
_ = kwargs
self._run_name = run_name
self._model = model
self._opt = opt
Expand Down Expand Up @@ -98,6 +99,8 @@ def _train_val_iteration(
torch.Tensor: The loss for the batch.
Dict[str, torch.Tensor]: The loss components for the batch.
"""
_ = epoch
_ = validation
# TODO: You'll most likely want to override this method.
x, y = batch
y_hat = self._model(x)
Expand Down Expand Up @@ -433,6 +436,8 @@ def _terminator(self, sig, frame):
"""
Handles the SIGINT signal (Ctrl+C) and stops the training loop.
"""
_ = sig
_ = frame
if (
project_conf.SIGINT_BEHAVIOR
== project_conf.TerminationBehavior.WAIT_FOR_EPOCH_END
Expand Down
5 changes: 3 additions & 2 deletions utils/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
import torch

import conf.project as project_conf
from utils import to_cuda_


def visualize_model_predictions(
model: torch.nn.Module, batch: Union[Tuple, List, torch.Tensor], step: int
) -> None:
x, y = to_cuda_(batch) # type: ignore
_ = model
_ = step
_ = batch
if not project_conf.HEADLESS:
raise NotImplementedError("Visualization is not implemented.")
if project_conf.USE_WANDB:
Expand Down

0 comments on commit b1c6c2e

Please sign in to comment.