CopyToο
- class dgl.graphbolt.CopyTo(datapipe, device)[source]ο
Bases:
IterDataPipe
DataPipe that transfers each element yielded from the previous DataPipe to the given device. For MiniBatch, only the related attributes (automatically inferred) will be transferred by default.
Functional name:
copy_to
.When
data
hasto
method implemented,CopyTo
will be equivalent tofor data in datapipe: yield data.to(device)
- Parameters:
datapipe (DataPipe) β The DataPipe.
device (torch.device) β The PyTorch CUDA device.