stable-baselines3 icon indicating copy to clipboard operation
stable-baselines3 copied to clipboard

`test_buffers.py::test_device` was not actually checking the device of tensors

Open rhaps0dy opened this issue 2 years ago • 0 comments

Description

I added a failure in case of unknown type to test_buffers.py::test_device, and made it iterate correctly through Tensors and dicts.

Motivation and Context

In test_buffers.py::test_device, the assertions that the device be the correct one would not be executed for RolloutBuffer and DictRolloutBuffer: the type of value is RolloutBufferSamples and DictRolloutBufferSamples respectively and so falls to the else case.

I have not raised an issue on purpose, why bother for a tiny bugfix.

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation (update in the documentation)

Checklist:

  • [x] I've read the CONTRIBUTION guide (required)
  • [x] I have updated the changelog accordingly (required).
  • [ ] My change requires a change to the documentation.
  • [x] I have updated the tests accordingly (required for a bug fix or a new feature).
  • [ ] I have updated the documentation accordingly.
  • [x] I have reformatted the code using make format (required)
  • [x] I have checked the codestyle using make check-codestyle and make lint (required)
  • [x] I have ensured make pytest and make type both pass. (required)
  • [x] I have checked that the documentation builds using make doc (required)

Note: You can run most of the checks using make commit-checks.

Note: we are using a maximum length of 127 characters per line

rhaps0dy avatar Sep 18 '23 23:09 rhaps0dy