torch icon indicating copy to clipboard operation
torch copied to clipboard

support torch_device() and how it's used

Open skeydan opened this issue 5 years ago • 1 comments

Not sure if we want this:

with (cuda_device(1)), {
    t1 <- torch_ones(c(2,2))
    t2 <- torch_randn(c(2,4))
    t1$mm(t2)
}

but we'd need something equivalent in function to

with torch.cuda.device(0):
    t1 = torch.ones((2,2))
    t2 = torch.randn((2,4))
    t1.mm(t2)

skeydan avatar Jun 25 '20 13:06 skeydan

I explored this in the #127 but didnt have success... Will wait to see if I get answers in the forum.

dfalbel avatar Jun 26 '20 19:06 dfalbel