Removed redundant double-check of nested Dict (#908)

* Removed redundant double-check of nested Dict observation space from BaseAlgorithm

* Update changelog

Co-authored-by: tibigg <tg4018@ic.ac.uk>
This commit is contained in:
TibiGG 2022-05-09 12:36:15 +01:00 committed by GitHub
parent 0fadc94df3
commit 2fcf8f91c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -33,6 +33,7 @@ Deprecations:
Others:
^^^^^^^
- Upgraded to Python 3.7+ syntax using ``pyupgrade``
- Removed redundant double-check for nested observations from ``BaseAlgorithm._wrap_env`` (@TibiGG)
Documentation:
^^^^^^^^^^^^^^
@ -970,4 +971,4 @@ And all the contributors:
@wkirgsn @AechPro @CUN-bjy @batu @IljaAvadiev @timokau @kachayev @cleversonahum
@eleurent @ac-93 @cove9988 @theDebugger811 @hsuehch @Demetrio92 @thomasgubler @IperGiove @ScheiklP
@simoninithomas @armandpl @manuel-delverme @Gautam-J @gianlucadecola @buoyancy99 @caburu @xy9485
@Gregwar @ycheng517 @quantitative-technologies @bcollazo @git-thor
@Gregwar @ycheng517 @quantitative-technologies @bcollazo @git-thor @TibiGG

View file

@ -209,11 +209,6 @@ class BaseAlgorithm(ABC):
# Make sure that dict-spaces are not nested (not supported)
check_for_nested_spaces(env.observation_space)
if isinstance(env.observation_space, gym.spaces.Dict):
for space in env.observation_space.spaces.values():
if isinstance(space, gym.spaces.Dict):
raise ValueError("Nested observation spaces are not supported (Dict spaces inside Dict space).")
if not is_vecenv_wrapped(env, VecTransposeImage):
wrap_with_vectranspose = False
if isinstance(env.observation_space, gym.spaces.Dict):