Skip to content

Commit

Permalink
fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
smanolloff committed Sep 20, 2023
1 parent 7da3e8f commit 1d5739e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/imitation/algorithms/adversarial/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import abc
import dataclasses
import logging
from typing import Iterable, Iterator, Mapping, Optional, Type, overload
from typing import Iterable, Iterator, Mapping, Optional, Type, List, overload

import numpy as np
import torch as th
Expand Down Expand Up @@ -408,7 +408,10 @@ def train_gen(
if learn_kwargs is None:
learn_kwargs = {}

callbacks = [self.gen_callback]
callbacks: List[BaseCallback] = []

if self.gen_callback:
callbacks.append(self.gen_callback)

if isinstance(callback, list):
callbacks.extend(callback)
Expand Down
2 changes: 1 addition & 1 deletion src/imitation/scripts/train_adversarial.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(
interval: int,
):
"""Creates new Checkpoint callback."""
super().__init__(self)
super().__init__()
self.trainer = trainer
self.log_dir = log_dir
self.interval = interval
Expand Down

0 comments on commit 1d5739e

Please sign in to comment.