Skip to content

Conversation

@sash-a
Copy link
Collaborator

@sash-a sash-a commented Sep 8, 2023

The reward_spec and discount_spec methods are not in Wrapper. As such when wrapping an environment with a reward/discount spec that is not the default (shape=()), the reward and discount specs are set to the default unless they are specified again in the wrapper.

For example

class MyWrapper(Wrapper):
    def reset(self, key):
        do_some_stuff()
        return self._env.reset(key)

env = Connector()
wrapped = MyWrapper(env)

env.reward_spec() == wrapped.reward_spec()  # <-- false

@sash-a sash-a self-assigned this Sep 8, 2023
@sash-a sash-a added the bug Something isn't working label Sep 8, 2023
Copy link
Contributor

@clement-bonnet clement-bonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted, thanks!

@clement-bonnet clement-bonnet merged commit e8d51e0 into instadeepai:main Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants