mindspore-ai / mindspore

MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
https://gitee.com/mindspore/mindspore
Apache License 2.0
4.26k stars 705 forks source link

[Enhancement] an enhancement about the error message of mindspore.ops.permute #268

Closed Redmept1on closed 5 months ago

Redmept1on commented 5 months ago

Background

The error message should be more explicit when the axis parameter of mindspore.ops.permute has the same dimension.

Introduction

Maybe follow pytorch

mindspore

import mindspore as mind
import numpy as np

a = mind.tensor(np.array([[1, 2, 3], [float('nan'), 5, 6]]),dtype=mind.float32)
max1 = mind.ops.permute(a,(0, 0))
print(max1)

image

pytorch

import torch
import numpy as np

a = torch.tensor(np.array([[1, 2, 3], [float('nan'), 5, 6]]),dtype=torch.float32)
max1 = torch.permute(a,(0, 0))
print(max1)

image

1071034024 commented 5 months ago

Thanks for your suggestion, we will fix it in the next version