Skip to content

Commit e02ddf2

Browse files
committed
fix ops bug
1 parent 70da2c1 commit e02ddf2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tensorlayerx/backend/ops/mindspore_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def set_context(**kwargs):
6868

6969

7070
def get_tensor_shape(x):
71-
return list(P.Shape()(x))
71+
return list(x.shape)
7272

7373

7474
# initializers

tensorlayerx/backend/ops/paddle_backend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def set_context(**kwargs):
8383

8484

8585
def get_tensor_shape(x):
86-
return pd.shape(x)
86+
return list(x.shape)
8787

8888

8989
# initializers
@@ -1213,6 +1213,8 @@ def floor(x):
12131213
def gather(params, indices, axis=None):
12141214
if axis < 0:
12151215
axis = len(params.shape) + axis
1216+
if axis is None:
1217+
axis = 0
12161218
return pd.gather(params, indices, axis)
12171219

12181220

0 commit comments

Comments
 (0)