local_device function

Device contexts

Device contexts

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.

Functions

  • with_device(): Modifies the default device for the selected context.
  • Maintainer: Daniel Falbel
  • License: MIT + file LICENSE
  • Last published: 2025-02-14