misantamaria commited on
Commit
5518ac2
·
1 Parent(s): 4e32ad2

Update r_shiny_app/global.R

Browse files
Files changed (1) hide show
  1. r_shiny_app/global.R +3 -0
r_shiny_app/global.R CHANGED
@@ -32,8 +32,11 @@ torch <- reticulate::import("torch")
32
  #options(shiny.trace = TRUE)
33
  if(torch$cuda$is_available()){
34
  print(paste0("CUDA AVAILABLE. Num devices: ", torch$cuda$device_count()))
 
 
35
  device=as.integer(0)
36
  print(paste0("Set up device ordinal "), device)
 
37
  torch$cuda$set_device(device)
38
  print(paste0("Device setted up"))
39
  #torch$cuda$set_device(as.integer(1))
 
32
  #options(shiny.trace = TRUE)
33
  if(torch$cuda$is_available()){
34
  print(paste0("CUDA AVAILABLE. Num devices: ", torch$cuda$device_count()))
35
+ print(paste0("current", torch$current_device()))
36
+ fflush.console()
37
  device=as.integer(0)
38
  print(paste0("Set up device ordinal "), device)
39
+ fflush.console();
40
  torch$cuda$set_device(device)
41
  print(paste0("Device setted up"))
42
  #torch$cuda$set_device(as.integer(1))