[tests] multiple improvements (#12294)
* [tests] multiple improvements * cleanup * style * todo to investigate * fix
This commit is contained in:
@@ -431,6 +431,7 @@ decorators are used to set the requirements of tests CPU/GPU/TPU-wise:
|
||||
* ``require_torch_gpu`` - as ``require_torch`` plus requires at least 1 GPU
|
||||
* ``require_torch_multi_gpu`` - as ``require_torch`` plus requires at least 2 GPUs
|
||||
* ``require_torch_non_multi_gpu`` - as ``require_torch`` plus requires 0 or 1 GPUs
|
||||
* ``require_torch_up_to_2_gpus`` - as ``require_torch`` plus requires 0 or 1 or 2 GPUs
|
||||
* ``require_torch_tpu`` - as ``require_torch`` plus requires at least 1 TPU
|
||||
|
||||
Let's depict the GPU requirements in the following table:
|
||||
@@ -447,6 +448,8 @@ Let's depict the GPU requirements in the following table:
|
||||
+----------+----------------------------------+
|
||||
| ``< 2`` | ``@require_torch_non_multi_gpu`` |
|
||||
+----------+----------------------------------+
|
||||
| ``< 3`` | ``@require_torch_up_to_2_gpus`` |
|
||||
+----------+----------------------------------+
|
||||
|
||||
|
||||
For example, here is a test that must be run only when there are 2 or more GPUs available and pytorch is installed:
|
||||
|
||||
Reference in New Issue
Block a user