Replies: 1 comment 1 reply
-
You could do that in two different ways: If you want to store things of different shapes alongside each other (again, not my preferred option) you can stack any spec using spec = torch.stack([
CompositeSpec(obs=UnboundedContinuousTensorSpec(shape=(3,))),
CompositeSpec(obs=UnboundedContinuousTensorSpec(shape=(4,))),
], 0) That spec will give you a Otherwise you should store each group / agent separately: spec = CompositeSpec(agent1 = UnboundedContinuousTensorSpec(shape=(3,))), agent2 = UnboundedContinuousTensorSpec(shape=(4,)))) What's the use case you have in mind by the way? |
Beta Was this translation helpful? Give feedback.
-
I am trying to use torchRL to do a MARL project, and the agents in my env have observation and action in different shape.
I found it quite difficult to use tensordict to store these values.
I wonder if torchRL can handle this?
By the way, can torchRL works with fedreated learning frameworks like flower?
Beta Was this translation helpful? Give feedback.
All reactions