Skip to content
Discussion options

You must be logged in to vote

It is convenient to transfer a data object between CPU and GPU, e.g.,

for data in train_loader:
    data = data.to('cuda')

Or you can do it within the model

    def forward(self, x, edge_index, batch): 
        x = x.to('cuda')
        edge_index = edge_index.to('cuda')
        batch= batch.to('cuda')

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@EdisonLeeeee
Comment options

@anthonysirico
Comment options

@anthonysirico
Comment options

@EdisonLeeeee
Comment options

@anthonysirico
Comment options

Answer selected by anthonysirico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants