declearn.utils.set_device_policy
Update the current global device policy.
To access the current policy, use declearn.utils.set_device_policy
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gpu |
bool
|
Whether to use a GPU device rather than the CPU one to back data and computations. If no GPU is available, use CPU with a warning. |
required |
idx |
Optional[int]
|
Optional index of the GPU device to use. If this index exceeds the number of available GPUs, select one arbitrarily, with a warning. |
None
|
Source code in declearn/utils/_device_policy.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|