TensorDictBase.asend#
- async TensorDictBase.asend(dst: TensorDictPipe) None#
Sends the tensordict through a UCXX pipe, asynchronously.
Awaits
dst.asend(self). SeeTensorDictPipe, which needs the optionalucxxpackage.- Parameters:
dst (TensorDictPipe) – the pipe to send through.
See also
send(), which also takes a pipe, and works withoutawait.Examples
This example needs
ucxxand a receiver on the other end of the pipe:async def produce(pipe): for _ in range(10): await TensorDict(obs=torch.randn(64, 84)).asend(pipe)
Every tensordict class and every tensorclass has this method. For the other methods, see Methods by task.