From 6379cf9ddd7d56bdf361dca9eca358605e2b566a Mon Sep 17 00:00:00 2001 From: A K Date: Wed, 27 Dec 2023 02:44:39 -0800 Subject: [PATCH] Fix pre-commit issues --- .pre-commit-config.yaml | 6 +++--- sample_factory/model/actor_critic.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c731a388a..9cd8da37e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ repos: - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.12.1 hooks: - id: black - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort name: isort (python) - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 diff --git a/sample_factory/model/actor_critic.py b/sample_factory/model/actor_critic.py index 7748370c9..f6550aa13 100644 --- a/sample_factory/model/actor_critic.py +++ b/sample_factory/model/actor_critic.py @@ -76,7 +76,7 @@ def initialize_weights(self, layer): layer.bias.data.fill_(0) if self.cfg.policy_initialization == "orthogonal": - if type(layer) == nn.Conv2d or type(layer) == nn.Linear: + if type(layer) is nn.Conv2d or type(layer) is nn.Linear: nn.init.orthogonal_(layer.weight.data, gain=gain) else: # LSTMs and GRUs initialize themselves @@ -85,7 +85,7 @@ def initialize_weights(self, layer): # go with default initialization, pass elif self.cfg.policy_initialization == "xavier_uniform": - if type(layer) == nn.Conv2d or type(layer) == nn.Linear: + if type(layer) is nn.Conv2d or type(layer) is nn.Linear: nn.init.xavier_uniform_(layer.weight.data, gain=gain) else: pass