Skip to content

Commit

Permalink
yapf
Browse files Browse the repository at this point in the history
  • Loading branch information
akihironitta authored and Borda committed Jan 18, 2021
1 parent 25cc5db commit 2b6dc4d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion pl_bolts/models/detection/__init__.py
@@ -1,5 +1,5 @@
from pl_bolts.models.detection.faster_rcnn import FasterRCNN # noqa: F401

__all__ = [
"FasterRCNN"
"FasterRCNN",
]
8 changes: 2 additions & 6 deletions pl_bolts/models/detection/faster_rcnn/faster_rcnn_module.py
Expand Up @@ -20,9 +20,7 @@ def _evaluate_iou(target, pred):
from model
"""
if not _TORCHVISION_AVAILABLE: # pragma: no cover
raise ModuleNotFoundError(
'You want to use `torchvision` which is not installed yet.'
)
raise ModuleNotFoundError('You want to use `torchvision` which is not installed yet.')

if pred["boxes"].shape[0] == 0:
# no box detected, 0 IOU
Expand Down Expand Up @@ -71,9 +69,7 @@ def __init__(
trainable_backbone_layers: number of trainable resnet layers starting from final block
"""
if not _TORCHVISION_AVAILABLE: # pragma: no cover
raise ModuleNotFoundError(
'You want to use `torchvision` which is not installed yet.'
)
raise ModuleNotFoundError('You want to use `torchvision` which is not installed yet.')

super().__init__()

Expand Down
4 changes: 1 addition & 3 deletions pl_bolts/models/mnist_module.py
Expand Up @@ -19,9 +19,7 @@ class LitMNIST(LightningModule):

def __init__(self, hidden_dim=128, learning_rate=1e-3, batch_size=32, num_workers=4, data_dir='', **kwargs):
if not _TORCHVISION_AVAILABLE: # pragma: no cover
raise ModuleNotFoundError(
'You want to use `torchvision` which is not installed yet.'
)
raise ModuleNotFoundError('You want to use `torchvision` which is not installed yet.')

super().__init__()
self.save_hyperparameters()
Expand Down
16 changes: 4 additions & 12 deletions pl_bolts/models/rl/common/gym_wrappers.py
Expand Up @@ -30,9 +30,7 @@ class ToTensor(Wrapper):

def __init__(self, env=None):
if not _GYM_AVAILABLE: # pragma: no cover
raise ModuleNotFoundError(
'You want to use `gym` which is not installed yet.'
)
raise ModuleNotFoundError('You want to use `gym` which is not installed yet.')

super(ToTensor, self).__init__(env)

Expand All @@ -51,9 +49,7 @@ class FireResetEnv(Wrapper):

def __init__(self, env=None):
if not _GYM_AVAILABLE: # pragma: no cover
raise ModuleNotFoundError(
'You want to use `gym` which is not installed yet.'
)
raise ModuleNotFoundError('You want to use `gym` which is not installed yet.')

super(FireResetEnv, self).__init__(env)
assert env.unwrapped.get_action_meanings()[1] == "FIRE"
Expand All @@ -80,9 +76,7 @@ class MaxAndSkipEnv(Wrapper):

def __init__(self, env=None, skip=4):
if not _GYM_AVAILABLE: # pragma: no cover
raise ModuleNotFoundError(
'You want to use `gym` which is not installed yet.'
)
raise ModuleNotFoundError('You want to use `gym` which is not installed yet.')

super(MaxAndSkipEnv, self).__init__(env)
# most recent raw observations (for max pooling across time steps)
Expand Down Expand Up @@ -202,9 +196,7 @@ class DataAugmentation(ObservationWrapper):

def __init__(self, env=None):
if not _GYM_AVAILABLE: # pragma: no cover
raise ModuleNotFoundError(
'You want to use `gym` which is not installed yet.'
)
raise ModuleNotFoundError('You want to use `gym` which is not installed yet.')

super().__init__(env)
self.observation_space = gym.spaces.Box(low=0, high=255, shape=(84, 84, 1), dtype=np.uint8)
Expand Down

0 comments on commit 2b6dc4d

Please sign in to comment.