How to send multiple tensors by torch.distributed.send?

Viewed 8

I would like to send multiple tensors with different shape together at a time. For example, a tuple of tensors (image, label). image is a tensor with shape like (3,32,32), and label is a single value tenor.

I read the tutorial post about how to use torch.distributed.send. But I don't know how to send two tensors together. Since sending two tensors two times is not efficient, so I am thinking how to send two tensors together at a time. My question is how to do the implementation.

Note: You can find the example script of this section in this GitHub repository.

0 Answers
Related