提交 1d9e51c1 authored 作者: Frederic Bastien's avatar Frederic Bastien

Convert a segfault to a Python error.

上级 0547e9c8
...@@ -165,10 +165,13 @@ class GpuElemwise(HideC, Elemwise): ...@@ -165,10 +165,13 @@ class GpuElemwise(HideC, Elemwise):
scal_v_out = fake_node.outputs scal_v_out = fake_node.outputs
assert len(scal_v_out) == len(node.outputs) assert len(scal_v_out) == len(node.outputs)
kop = fake_node.op.c_code(fake_node, 'elem_scalar', try:
inps, outs, kop = fake_node.op.c_code(fake_node, 'elem_scalar',
dict(fail='return;')) inps, outs,
dict(fail='return;'))
except MethodNotDefined:
raise AssertionError(
"No c code for this scalar. Can not make a GpuElemwise")
# If the following assert fail, then we need to update the # If the following assert fail, then we need to update the
# code handler above. # code handler above.
assert 'npy_float16' not in kop assert 'npy_float16' not in kop
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论