提交 08a6b966 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Assert that the C code is cpu-only rather than fallback to python.

上级 11d58402
...@@ -369,8 +369,10 @@ class mrg_uniform(mrg_uniform_base): ...@@ -369,8 +369,10 @@ class mrg_uniform(mrg_uniform_base):
def c_code(self, node, name, inp, out, sub): def c_code(self, node, name, inp, out, sub):
rstate, size = inp rstate, size = inp
if not isinstance(node.inputs[0].type, TensorType): # If we try to use the C code here with something else than a
raise NotImplementedError("C code is cpu-only") # TensorType, something is wrong (likely one of the GPU ops
# not defining C code correctly).
assert isinstance(node.inputs[0].type, TensorType):
o_rstate, o_sample = out o_rstate, o_sample = out
if self.inplace: if self.inplace:
o_rstate_requirement = 'NPY_ARRAY_C_CONTIGUOUS|NPY_ARRAY_ALIGNED' o_rstate_requirement = 'NPY_ARRAY_C_CONTIGUOUS|NPY_ARRAY_ALIGNED'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论