Closed SobhanMP closed 1 year ago
Hi @SobhanMP good catch, I think in the second call either handle0
or handle1
works.
Even though we version the handles, behind the scene they share the same c++ object. The versioning is to force the sequence of execution.
For example, instead of versioning, we could use a single handle. This will cause send and recv to happen sequentially. recv is only executed after send.
handle = send(handle, action, states.observation.env_id)
handle, new_states = recv(handle)
The reason why we use handle0
in the recv
call is to avoid waiting for the send to finish, this is safe in the asynchronous mode.
It is explained in the documentation. https://envpool.readthedocs.io/en/latest/content/xla_interface.html
Oh, that's pretty neat
Describe the bug
I think https://github.com/sail-sg/envpool/blob/aacf06f694ead2eb75331f085f00dad71eec1a08/examples/xla_step.py#L93 should be
handle1, new_states = recv(handle1)
nothandle1, new_states = recv(handle0)
or am I missing something?