Open Redmept1on opened 3 months ago
oneflow.argmin has this issue too
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.argmin(x1,dim=0)
print(y1.device,y1)
x1 = flow.tensor(np.array([[float('inf'), 0, -1, float('nan'), 5]], dtype=np.float32))
x1 = x1.cpu()
y2 = flow.argmin(x1,dim=0)
print(y2.device,y2)
pytorch
import torch
import numpy as np
input_tensor = torch.tensor(np.array([[float('inf'), 0, -1, float('nan'), 5]], dtype=np.float32))
# other_tensor = torch.tensor(np.array([0, 1, 1], dtype=np.float32))
output_tensors = torch.argmin(input_tensor,dim=0)
print(output_tensors)
Summary
oneflow.argmax perform differently between cpu and cuda. cpu result equal to pytorch.
Code to reproduce bug
pytorch
System Information