@@ -25,32 +25,34 @@ Automatic Backend Management is done by two simple functions: `cpu_device` and `
2525
2626* [ ` cpu_device ` ] ( @ref ) : This is a simple function and just returns a ` CPUDevice ` object.
2727
28- ``` @example gpu_management
29- cdev = cpu_device()
30- ```
28+ ``` @example gpu_management
29+ cdev = cpu_device()
30+ ```
3131
32- ``` @example gpu_management
33- x_cpu = randn(Float32, 3, 2)
34- ```
32+ ``` @example gpu_management
33+ x_cpu = randn(Float32, 3, 2)
34+ ```
3535
3636* [ ` gpu_device ` ] ( @ref ) : This function performs automatic GPU device selection and returns
37- an object.
38- 1 . If no GPU is available, it returns a ` CPUDevice ` object.
39- 2 . If a LocalPreferences file is present, then the backend specified in the file is used.
40- To set a backend, use ` Lux.gpu_backend!(<backend_name>) ` . (a) If the trigger package
41- corresponding to the device is not loaded, then a warning is displayed. (b) If no
42- LocalPreferences file is present, then the first working GPU with loaded trigger
43- package is used.
44-
45- ``` @example gpu_management
46- gdev = gpu_device()
47-
48- x_gpu = x_cpu |> gdev
49- ```
50-
51- ``` @example gpu_management
52- (x_gpu |> cdev) ≈ x_cpu
53- ```
37+ an object.
38+
39+ 1 . If no GPU is available, it returns a ` CPUDevice ` object.
40+
41+ 2 . If a LocalPreferences file is present, then the backend specified in the file is used.
42+ To set a backend, use ` Lux.gpu_backend!(<backend_name>) ` . (a) If the trigger package
43+ corresponding to the device is not loaded, then a warning is displayed. (b) If no
44+ LocalPreferences file is present, then the first working GPU with loaded trigger
45+ package is used.
46+
47+ ``` @example gpu_management
48+ gdev = gpu_device()
49+
50+ x_gpu = x_cpu |> gdev
51+ ```
52+
53+ ``` @example gpu_management
54+ (x_gpu |> cdev) ≈ x_cpu
55+ ```
5456
5557## Manual Backend Management
5658
0 commit comments