From 18b29a68e8d5a11d0e98aeea539c247f0a913019 Mon Sep 17 00:00:00 2001 From: Juan Rocamonde Date: Sun, 11 Sep 2022 18:39:13 +0200 Subject: [PATCH] Remove forward() method from common.policies.BaseModel (#1061) * Remove forward() method. * Updated changelog --- docs/misc/changelog.rst | 1 + stable_baselines3/common/policies.py | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/misc/changelog.rst b/docs/misc/changelog.rst index f0f9d5a..0d745e5 100644 --- a/docs/misc/changelog.rst +++ b/docs/misc/changelog.rst @@ -29,6 +29,7 @@ Bug Fixes: - Fixed missing verbose parameter passing in the ``EvalCallback`` constructor (@burakdmb) - Fixed the issue that when updating the target network in DQN, SAC, TD3, the ``running_mean`` and ``running_var`` properties of batch norm layers are not updated (@honglu2875) - Fixed incorrect type annotation of the replay_buffer_class argument in ``common.OffPolicyAlgorithm`` initializer, where an instance instead of a class was required (@Rocamonde) +- Removed ``forward()`` abstract method declaration from ``common.policies.BaseModel`` (already defined in ``torch.nn.Module``) to fix type errors in subclasses (@Rocamonde) Deprecations: ^^^^^^^^^^^^^ diff --git a/stable_baselines3/common/policies.py b/stable_baselines3/common/policies.py index 3809b61..cd372e1 100644 --- a/stable_baselines3/common/policies.py +++ b/stable_baselines3/common/policies.py @@ -87,10 +87,6 @@ class BaseModel(nn.Module, ABC): self.features_extractor_class = features_extractor_class self.features_extractor_kwargs = features_extractor_kwargs - @abstractmethod - def forward(self, *args, **kwargs): - pass - def _update_features_extractor( self, net_kwargs: Dict[str, Any],