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

Remove redundant code following review

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