Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca authored Aug 5, 2021
1 parent f531595 commit 82d080e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pl_bolts/models/rl/dqn_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ def add_model_specific_args(arg_parser: argparse.ArgumentParser, ) -> argparse.A

return arg_parser

def _use_dp_or_ddp2(self, trainer: Trainer) -> bool:
@staticmethod
def _use_dp_or_ddp2(trainer: Trainer) -> bool:
# for backwards compatibility
if _PL_GREATER_EQUAL_1_4:
return trainer.accelerator_connector.use_dp or trainer.accelerator_connector.use_ddp2
Expand Down
3 changes: 2 additions & 1 deletion pl_bolts/models/self_supervised/moco/moco2_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ def add_model_specific_args(parent_parser):

return parser

def _use_ddp_or_ddp2(self, trainer: Trainer) -> bool:
@staticmethod
def _use_ddp_or_ddp2(trainer: Trainer) -> bool:
# for backwards compatibility
if _PL_GREATER_EQUAL_1_4:
return trainer.accelerator_connector.use_ddp or trainer.accelerator_connector.use_ddp2
Expand Down

0 comments on commit 82d080e

Please sign in to comment.