提交 912d125e authored 作者: --global's avatar --global

Standardize CuDNN RuntimeError messages

上级 486b760d
...@@ -555,11 +555,9 @@ class GpuDnnConv(DnnBase, COp): ...@@ -555,11 +555,9 @@ class GpuDnnConv(DnnBase, COp):
# are both unavailable. # are both unavailable.
if version() < (3000, 3000): if version() < (3000, 3000):
if self.workmem == 'fft': if self.workmem == 'fft':
raise RuntimeError("CuDNN's FFT convolution is only available " raise RuntimeError("CuDNN FFT convolution requires CuDNN v3")
"starting at CuDNN v3")
elif self.workmem == 'time': elif self.workmem == 'time':
raise RuntimeError("CuDNN's convolution timing option is only " raise RuntimeError("CuDNN convolution timing requires CuDNN v3")
"available starting at CuDNN v3")
assert self.workmem in ['none', 'small', 'large', 'fft', 'time', assert self.workmem in ['none', 'small', 'large', 'fft', 'time',
'guess'] 'guess']
...@@ -1298,7 +1296,7 @@ class GpuDnnPoolDesc(GpuOp): ...@@ -1298,7 +1296,7 @@ class GpuDnnPoolDesc(GpuOp):
raise RuntimeError("CuDNN pooling with padding requires CuDNN v2") raise RuntimeError("CuDNN pooling with padding requires CuDNN v2")
assert nd in (2, 3) assert nd in (2, 3)
if nd == 3 and version() < (3000, 3000): if nd == 3 and version() < (3000, 3000):
raise RuntimeError("3 pooling only supported on CuDNN v3") raise RuntimeError("CuDNN 3d pooling requires CuDNN v3")
self.nd = nd self.nd = nd
def __setstate__(self, d): def __setstate__(self, d):
...@@ -1729,8 +1727,7 @@ class GpuDnnSoftmaxBase(DnnBase): ...@@ -1729,8 +1727,7 @@ class GpuDnnSoftmaxBase(DnnBase):
self.tensor_format = tensor_format self.tensor_format = tensor_format
if algo == 'log' and version() < (3000, 3000): if algo == 'log' and version() < (3000, 3000):
raise RuntimeError("CuDNN's log-softmax implementation is only " raise RuntimeError("CuDNN log-softmax requires CuDNN v3")
"supported starting at CuDNN v3")
assert(algo in ('fast', 'accurate', 'log')) assert(algo in ('fast', 'accurate', 'log'))
self.algo = algo self.algo = algo
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论