提交 acbd8b54 authored 作者: Frederic Bastien's avatar Frederic Bastien

escape the char % in Composite op when we use it with the Mod op.

上级 5c2a6cd7
...@@ -1414,12 +1414,16 @@ class Composite(ScalarOp): ...@@ -1414,12 +1414,16 @@ class Composite(ScalarOp):
name = "V%%(id)s_tmp%i" % i name = "V%%(id)s_tmp%i" % i
subd[output] = name subd[output] = name
_c_code += "%s %s;\n" % (output.type.dtype_specs()[1], name) _c_code += "%s %s;\n" % (output.type.dtype_specs()[1], name)
_c_code += node.op.c_code(node,
s = node.op.c_code(node,
"%(name)s", "%(name)s",
[subd[input] for input in node.inputs], [subd[input] for input in node.inputs],
[subd[output] for output in node.outputs], [subd[output] for output in node.outputs],
dict(fail = "%(fail)s", dict(fail = "%(fail)s",
id = "%%(id)s_%i" % j)) id = "%%(id)s_%i" % j))
if any([isinstance(x.op,Mod) for x in env.toposort()]):
s = s.replace('% ','%% ')
_c_code += s
_c_code += "\n" _c_code += "\n"
_c_code += "}\n" _c_code += "}\n"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论