提交 fab78d84 编写于 作者: J jiangjiajun

Merge branch 'master' of https://github.com/PaddlePaddle/X2Paddle

...@@ -439,24 +439,24 @@ class Network(object): ...@@ -439,24 +439,24 @@ class Network(object):
need_transpose = True need_transpose = True
if need_transpose: if need_transpose:
order = range(dims) in_order = range(dims)
order.remove(axis) in_order.remove(axis)
order.append(axis) in_order.append(axis)
input = fluid.layers.transpose( input = fluid.layers.transpose(
input, input,
perm=order, perm=in_order,
name=self.get_unique_output_name(name, 'transpose')) name=self.get_unique_output_name(name, 'transpose'))
output = fluid.layers.softmax( output = fluid.layers.softmax(
input, name=self.get_unique_output_name(name, 'softmax')) input, name=self.get_unique_output_name(name, 'softmax'))
if need_transpose: if need_transpose:
order = range(len(shape)) out_order = [0, ] * dims
order[axis] = dims - 1 for id, v in enumerate(in_order):
order[-1] = axis out_order[v] = id
output = fluid.layers.transpose( output = fluid.layers.transpose(
output, output,
perm=order, perm=out_order,
name=self.get_unique_output_name(name, 'transpose')) name=self.get_unique_output_name(name, 'transpose'))
return output return output
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册