提交 00821f97 authored 作者: carriepl's avatar carriepl

Remove redundant code following review

上级 ced656fa
......@@ -1482,18 +1482,16 @@ def local_logsoftmax_to_dnn(node, ctx_name):
# No log-softmax before cudnn v3
return
if (isinstance(node.op, LogSoftmax) and node.inputs[0].owner and
isinstance(node.inputs[0].owner.op, HostFromGpu)):
# Transform the input in the format expected by GpuDnnSoftmax
inp = node.inputs[0].owner.inputs[0]
if inp.ndim != 2:
return
inp = inp.dimshuffle(0, 1, 'x', 'x')
# Transform the input in the format expected by GpuDnnSoftmax
inp = node.inputs[0]
if inp.ndim != 2:
return
inp = inp.dimshuffle(0, 1, 'x', 'x')
inp.tag.context_name = ctx_name
# Apply GpuDnnSoftmax and return the result
out = GpuDnnSoftmax('log', 'channel')(gpu_contiguous(inp))
return [out.dimshuffle(0, 1)]
# Apply GpuDnnSoftmax and return the result
out = GpuDnnSoftmax('log', 'channel')(gpu_contiguous(inp))
return [out.dimshuffle(0, 1)]
class NoCuDNNRaise(Optimizer):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论