Open Redmept1on opened 3 months ago
oneflow.sort has same bug
oneflow.topk has the same bug
import oneflow as flow
import numpy as np
x1 = flow.tensor(np.array([[float('inf'), 0, -1, float('nan'), 5]], dtype=np.float32))
x1 = x1.cuda()
y1 = flow.topk(x1,k=2,dim=1)
print(y1)
x1 = flow.tensor(np.array([[float('inf'), 0, -1, float('nan'), 5]], dtype=np.float32))
x1 = x1.cpu()
y2 = flow.topk(x1,k=2,dim=1)
print(y2)
Summary
oneflow.argsort perform differently between cpu and cuda when dim=1, cuda=pytorch, cpu not
Code to reproduce bug
pytorch
System Information