local_device: Device contexts
Description
Device contexts
Usage
local_device(device, ..., .env = parent.frame())with_device(code, ..., device)
Arguments
- 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.