Trying to understand action_space_sample function

I have made a multi-agent env and am running into the “action/observation_space_sample/contains” of _ has not been implemented warning.

Can someone provide more context into how the below functions are used and where they are called in the code? I have already tried searching through the source code, but I’m still a bit confused.


Hi @aidansan, Can you share your stack trace?

The sample() / contains() are standard gym apis for any space. sample() can be used to get a sample obs/action tensor to initialize a policy.
contains() is also used for env_checking to make sure for example the action that the policy outputs is a valid action from the perspective of the environment.