Skip to content

Using transformations and custom environment with own rand_action? #2828

Answered by vmoens
TogetherLiving asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for raising this!

this is not what I want

I guess this is the line where the dummy rollout is gathered:

tensordict = parent.rollout(max_steps=num_iter)

In theory the rand_action of your env should be called unless you have a transform that affects the action:

def rand_action(self, tensordict: TensorDictBase | None = None) -> TensorDict:
if type(self.base_env).rand_action is not EnvBase.rand_action:
# TODO: this will fail if the transform modifies the input.
# For instance, if an env overrides rand_action …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TogetherLiving
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants