FenTechSolutions / CausalDiscoveryToolbox

Package for causal inference in graphs and in the pairwise settings. Tools for graph structure recovery and dependencies are included.
https://fentechsolutions.github.io/CausalDiscoveryToolbox/html/index.html
MIT License
1.08k stars 198 forks source link

Fix data device errors in SAM_generators #18

Closed aldro61 closed 5 years ago

aldro61 commented 5 years ago

Hi Diviyan,

I encountered a device error when running the SAM code. Here's a simple fix.

Cheers, Alex

diviyank commented 5 years ago

Hi Alex, Thanks for the feedback, however, I don't see why you had an issue there: the line L291:

sam = sam.to(device)

should do the trick: it send all registered buffers on the GPU devices.

Best, Diviyan

aldro61 commented 5 years ago

I was also expecting the behaviour you mention. However I was getting some device errors in this class, which were solved by explicitly sending the tensors to the GPU. It seemed like the tensors were not getting pushed to the GPU, even after a call to sam.to(...).

It might due to my setup. I’ll investigate more and let you know. Feel free to close the PR in the mean time.

Thanks, Alex Le 2 juin 2019 12:06 -0400, Diviyan Kalainathan notifications@github.com, a écrit :

Hi Alex, Thanks for the feedback, however, I don't see why you had an issue there: the line L291: sam = sam.to(device) should do the trick: it send all registered buffers on the GPU devices. Best, Diviyan — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

diviyank commented 5 years ago

Ok noted, don't hesitate to reopen it if you have more info on the issue !

Best, Diviyan

diviyank commented 5 years ago

I also noticed this bug, I will apply the fix.