提交 3f0f841e authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Make sure to disable C code in CAReduceDtype if the accumulator is in float16.

上级 15c90dd3
......@@ -1288,7 +1288,6 @@ class PatternSub(LocalOptimizer):
return pattern.clone()
p = self.out_pattern
new = build(p, u)
# print "PatternSub matched:", new
return [new]
else:
return False
......
......@@ -1467,6 +1467,8 @@ class CAReduce(Op):
odtype = output.type.dtype_specs()[1]
if hasattr(self, 'acc_dtype') and self.acc_dtype is not None:
if self.acc_dtype == 'float16':
raise theano.gof.utils.MethodNotDefined("no c_code for float16")
acc_type = TensorType(
broadcastable=node.outputs[0].broadcastable,
dtype=self.acc_dtype)
......@@ -1632,7 +1634,7 @@ for(int i=0;i<PyArray_NDIM(%(iname)s);i++){
return ['<vector>', '<algorithm>']
def c_code_cache_version_apply(self, node):
version = [5] # the version corresponding to the c code in this Op
version = (6,) # the version corresponding to the c code in this Op
# now we insert versions for the ops on which we depend...
scalar_node = Apply(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论