!12820 Fix: TimeDistributed Bug

From: @dinglongwei
Reviewed-by: @liangchenghui,@c_34
Signed-off-by: @liangchenghui
This commit is contained in:
mindspore-ci-bot 2021-03-04 09:37:34 +08:00 committed by Gitee
commit 18d55a8a7c
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ def _check_expand_dims_axis(time_axis, ndim):
def _generate_perm(axis_a, axis_b, length):
perm = tuple(range(length))
axis_a, axis_b = (axis_a, axis_b) if axis_a < axis_b else (axis_b, axis_a)
return perm[:axis_a] + perm[axis_a + 1: axis_b + 1] + (perm[axis_a],) + perm[axis_b + 1:]
return perm[:axis_a] + (perm[axis_b],) + perm[axis_a: axis_b] + perm[axis_b + 1:]
@constexpr