Device contexts
local_device(device, ..., .env = parent.frame()) with_device(code, ..., device)
device
: A torch device to be used by default when creating new tensors....
: currently unused..env
: The environment to use for scoping.code
: The code to be evaluated in the modified environment.with_device()
: Modifies the default device for the selected context.Useful links