Esempio n. 1
0
    def test_validate_parallel_params_raises_single_cpu():
        """Test _validate_parallel_params.

        Throws ValueError for passing a single gpu.
        """
        cpus = 1

        with pytest.raises(ValueError):
            Classifier._validate_parallel_params(cpus=cpus)
Esempio n. 2
0
    def test_validate_parallel_params_raises_cpus_gpus():
        """Test _validate_parallel_params.

        Throws ValueError for passing values for both cpus an gpus.
        """
        gpus = [0]
        cpus = 0

        with pytest.raises(ValueError):
            Classifier._validate_parallel_params(gpus=gpus, cpus=cpus)