提交 3b0c4946 authored 作者: Maxim Kochurov's avatar Maxim Kochurov 提交者: Brandon T. Willard

Remove GPU options from DeviceParam

上级 32b79040
...@@ -467,11 +467,11 @@ class DeviceParam(ConfigParam): ...@@ -467,11 +467,11 @@ class DeviceParam(ConfigParam):
raise ValueError( raise ValueError(
'Invalid value ("{val}") for configuration ' 'Invalid value ("{val}") for configuration '
'variable "{self.name}". Valid options start with ' 'variable "{self.name}". Valid options start with '
'one of "cpu", "opencl" or "cuda".' 'one of "cpu".'
) )
def __str__(self): def __str__(self):
return f"{self.name} ({self.default}, opencl*, cuda*) " return f"{self.name} ({self.default})"
class ContextsParam(ConfigParam): class ContextsParam(ConfigParam):
......
...@@ -177,12 +177,13 @@ class TestConfigTypes: ...@@ -177,12 +177,13 @@ class TestConfigTypes:
def test_deviceparam(self): def test_deviceparam(self):
cp = configparser.DeviceParam("cpu", mutable=False) cp = configparser.DeviceParam("cpu", mutable=False)
assert cp.default == "cpu" assert cp.default == "cpu"
assert cp._apply("cuda123") == "cuda123" with pytest.raises(ValueError, match="It was removed from Aesara"):
with pytest.raises(ValueError, match="old GPU back-end"): cp._apply("cuda123")
with pytest.raises(ValueError, match="It was removed from Aesara"):
cp._apply("gpu123") cp._apply("gpu123")
with pytest.raises(ValueError, match="Invalid value"): with pytest.raises(ValueError, match='Valid options start with one of "cpu".'):
cp._apply("notadevice") cp._apply("notadevice")
assert str(cp) == "None (cpu, opencl*, cuda*) " assert str(cp) == "None (cpu)"
def test_config_context(): def test_config_context():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论