set_default_device

dragon.cuda.set_default_device(device_index=0)[source]

Set the default device.

A valid device index should be greater equal than 0:

dragon.cuda.set_default_device(0)   # Ok
dragon.cuda.set_default_device(-1)  # Reset to the cpu device
Parameters:
  • device_index (int) – The device index.