提交 dd98172a authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Remove hack in gpuarray/ to replace Cast by Cast16

上级 d43f6df9
......@@ -20,8 +20,3 @@ def write_w(dtype):
return '__float2half_rn'
else:
return ''
class Cast16(scalar.Cast):
def c_code(self, node, name, inputs, outputs, sub):
return "%s = %s;\n" % (outputs[0], inputs[0])
......@@ -258,20 +258,6 @@ def local_gpu_elemwise(node):
name = op.name
if name:
name = 'Gpu'+name
if (type(scal_op) == scalar.Cast and
(node.inputs[0].dtype == 'float16' or
node.outputs[0].dtype == 'float16')):
scal_op = fp16_help.Cast16(scal_op.o_type, name=scal_op.name)
if (type(scal_op) == scalar.Composite and
True):
inputs, outputs = gof.graph.clone(scal_op.inputs, scal_op.outputs)
for v in variables(inputs, outputs):
if (type(v.op) == scalar.Cast and
(v.inputs[0].dtype == 'float16' or
v.outputs[0].dtype == 'float16')):
# We cloned the graph before so this is ok
v.op = fp16_help.Cast16(v.op.o_type, name=v.op.name)
scal_op = scalar.Composite(inputs, outputs)
res = GpuElemwise(scal_op, name=name,
inplace_pattern=copy.copy(op.inplace_pattern),
nfunc_spec=op.nfunc_spec)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论