Oneflow-Inc / oneflow

OneFlow is a deep learning framework designed to be user-friendly, scalable and efficient.
http://www.oneflow.org
Apache License 2.0
5.79k stars 658 forks source link

When oneflow.permute is used for the same dimension operation, there is no crash, but the wrong result is returned #10451

Open Redmept1on opened 3 months ago

Redmept1on commented 3 months ago

Summary

When oneflow.permute is used for the same dimension operation, there is no crash, but the wrong result is returned. Checks of the same dimension should be added.

Code to reproduce bug

import oneflow as flow

x = flow.tensor([[1, 2, 3],[4, 5, 6]],dtype=flow.float32)
output = flow.permute(x, (0, 0))
print(output)

image

import torch

x = torch.tensor([[1, 2, 3],[4, 5, 6]],dtype=torch.float32)
output = x.permute(0,0)
print(output)

image

System Information