Skip to content

Commit

Permalink
Fix pre-commit issues
Browse files Browse the repository at this point in the history
  • Loading branch information
A K committed Dec 27, 2023
1 parent de799b5 commit 6379cf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions sample_factory/model/actor_critic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6379cf9

Please sign in to comment.