oneflow icon indicating copy to clipboard operation
oneflow copied to clipboard

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

Open Redempt1onzzZZ opened this issue 1 year ago • 0 comments

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

  • What is your OneFlow installation :dockerhub
  • OS: Linux
  • OneFlow version: 0.9.1.dev20231024+cu117
  • Python version: 3.8

Redempt1onzzZZ avatar Mar 18 '24 08:03 Redempt1onzzZZ