Skip to content

Commit b1c6c2e

Browse files
committed
Fix unused args
1 parent 556fdaf commit b1c6c2e

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/base_tester.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def __init__(
3939
train_loader (torch.utils.data.DataLoader): Training dataloader.
4040
val_loader (torch.utils.data.DataLoader): Validation dataloader.
4141
"""
42+
_ = kwargs
4243
self._run_name = run_name
4344
self._model = model
4445
assert model_ckpt_path is not None, "No model checkpoint path provided."
@@ -54,7 +55,9 @@ def _visualize(
5455
batch: Union[Tuple, List, torch.Tensor],
5556
epoch: int,
5657
) -> None:
57-
pass
58+
_ = epoch
59+
_ = batch
60+
raise NotImplementedError("You must implement the _visualize method.")
5861

5962
@to_cuda
6063
def _test_iteration(
@@ -79,6 +82,7 @@ def test(self, visualize_every: int = 0, **kwargs):
7982
visualize_every (int, optional): Visualize the model predictions every n batches.
8083
Defaults to 0 (no visualization).
8184
"""
85+
_ = kwargs
8286
test_loss: MeanMetric = MeanMetric()
8387
test_metrics: Dict[str, MeanMetric] = defaultdict(MeanMetric)
8488
self._model.eval()

src/base_trainer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def __init__(
4949
train_loader (torch.utils.data.DataLoader): Training dataloader.
5050
val_loader (torch.utils.data.DataLoader): Validation dataloader.
5151
"""
52+
_ = kwargs
5253
self._run_name = run_name
5354
self._model = model
5455
self._opt = opt
@@ -98,6 +99,8 @@ def _train_val_iteration(
9899
torch.Tensor: The loss for the batch.
99100
Dict[str, torch.Tensor]: The loss components for the batch.
100101
"""
102+
_ = epoch
103+
_ = validation
101104
# TODO: You'll most likely want to override this method.
102105
x, y = batch
103106
y_hat = self._model(x)
@@ -433,6 +436,8 @@ def _terminator(self, sig, frame):
433436
"""
434437
Handles the SIGINT signal (Ctrl+C) and stops the training loop.
435438
"""
439+
_ = sig
440+
_ = frame
436441
if (
437442
project_conf.SIGINT_BEHAVIOR
438443
== project_conf.TerminationBehavior.WAIT_FOR_EPOCH_END

utils/training.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
import torch
1616

1717
import conf.project as project_conf
18-
from utils import to_cuda_
1918

2019

2120
def visualize_model_predictions(
2221
model: torch.nn.Module, batch: Union[Tuple, List, torch.Tensor], step: int
2322
) -> None:
24-
x, y = to_cuda_(batch) # type: ignore
23+
_ = model
24+
_ = step
25+
_ = batch
2526
if not project_conf.HEADLESS:
2627
raise NotImplementedError("Visualization is not implemented.")
2728
if project_conf.USE_WANDB:

0 commit comments

Comments
 (0)