From 640487a9742a8ef4c355ecbeccca4bda7468782c Mon Sep 17 00:00:00 2001 From: dinglongwei Date: Wed, 3 Mar 2021 14:17:13 +0800 Subject: [PATCH] update mindspore/nn/layer/timedistributed.py. Fix: reshape with aix bug. --- mindspore/nn/layer/timedistributed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/nn/layer/timedistributed.py b/mindspore/nn/layer/timedistributed.py index 5bfd3906eaa..8f323ba1d9f 100644 --- a/mindspore/nn/layer/timedistributed.py +++ b/mindspore/nn/layer/timedistributed.py @@ -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