Temporarily set the default MLX device
with_default_device.RdTemporarily set the default MLX device
Usage
with_default_device(device = c("gpu", "cpu"), code)Examples
old <- mlx_default_device()
with_default_device("cpu", mlx_default_device())
#> [1] "cpu"
mlx_default_device(old)
#> [1] "gpu"