提交 708efc22 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix the broken test for float16 inputs/outputs in Elemwise and bump the Elemwise…

Fix the broken test for float16 inputs/outputs in Elemwise and bump the Elemwise version to make no bad code is used.
上级 fec62ac0
...@@ -1171,10 +1171,10 @@ class Elemwise(OpenMPOp): ...@@ -1171,10 +1171,10 @@ class Elemwise(OpenMPOp):
return decl, checks, alloc, loop return decl, checks, alloc, loop
def c_code(self, node, nodename, inames, onames, sub): def c_code(self, node, nodename, inames, onames, sub):
if any(i.dtype == 'float16' for i in node.inputs or if (any(i.dtype == 'float16' for i in node.inputs) or
o.dtype == 'float16' for o in node.inputs or any(o.dtype == 'float16' for o in node.outputs) or
# This is for Composite # This is for Composite
getattr(self.scalar_op, 'inner_float16', False)): getattr(self.scalar_op, 'inner_float16', False)):
# Disable C code for float16 vars # Disable C code for float16 vars
super(Elemwise, self).c_code(node, nodename, inames, onames, sub) super(Elemwise, self).c_code(node, nodename, inames, onames, sub)
code = "\n".join(self._c_all(node, nodename, inames, onames, sub)) code = "\n".join(self._c_all(node, nodename, inames, onames, sub))
...@@ -1192,7 +1192,7 @@ class Elemwise(OpenMPOp): ...@@ -1192,7 +1192,7 @@ class Elemwise(OpenMPOp):
return support_code return support_code
def c_code_cache_version_apply(self, node): def c_code_cache_version_apply(self, node):
version = [11] # the version corresponding to the c code in this Op version = [12] # the version corresponding to the c code in this Op
# now we insert versions for the ops on which we depend... # now we insert versions for the ops on which we depend...
scalar_node = Apply(self.scalar_op, scalar_node = Apply(self.scalar_op,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论