Consistent use of device as keyword argument (#702)

* consistent device as keyword arg

* Fixed ``device`` arg inconsistency in changelog
This commit is contained in:
Quentin Gallouédec 2021-12-22 11:43:59 +01:00 committed by GitHub
parent 798b16aaf7
commit d496cd4d95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -38,6 +38,7 @@ Others:
- Added a warning in the env checker when not using ``np.float32`` for continuous actions
- Improved test coverage and error message when checking shape of observation
- Added ``newline="\n"`` when opening CSV monitor files so that each line ends with ``\r\n`` instead of ``\r\r\n`` on Windows while Linux environments are not affected (@hsuehch)
- Fixed ``device`` argument inconsistency (@qgallouedec)
Documentation:
^^^^^^^^^^^^^^

View file

@ -197,14 +197,14 @@ class OffPolicyAlgorithm(BaseAlgorithm):
self.buffer_size,
self.observation_space,
self.action_space,
self.device,
device=self.device,
optimize_memory_usage=self.optimize_memory_usage,
)
self.replay_buffer = HerReplayBuffer(
self.env,
self.buffer_size,
self.device,
device=self.device,
replay_buffer=replay_buffer,
**self.replay_buffer_kwargs,
)
@ -214,7 +214,7 @@ class OffPolicyAlgorithm(BaseAlgorithm):
self.buffer_size,
self.observation_space,
self.action_space,
self.device,
device=self.device,
n_envs=self.n_envs,
optimize_memory_usage=self.optimize_memory_usage,
**self.replay_buffer_kwargs,

View file

@ -112,7 +112,7 @@ class OnPolicyAlgorithm(BaseAlgorithm):
self.n_steps,
self.observation_space,
self.action_space,
self.device,
device=self.device,
gamma=self.gamma,
gae_lambda=self.gae_lambda,
n_envs=self.n_envs,