oneflow
oneflow copied to clipboard
oneflow.matmul doesn't work for this situation
Summary
oneflow.matmul doesn't work for this situation
Code to reproduce 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()
x2 = flow.tensor(np.array([float('nan'), 0, -1, 1, 5], dtype=np.float32))
x2 = x2.cuda()
y1 = flow.matmul(x1,x2)
print(y1)
x1 = flow.tensor(np.array([float('inf'), 0, -1, float('nan'), 5], dtype=np.float32))
x1=x1.cpu()
x2 = flow.tensor(np.array([float('nan'), 0, -1, 1, 5], dtype=np.float32))
x2 = x2.cpu()
y2 = flow.matmul(x1,x2)
print(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([float('nan'), 0, -1, 1, 5], dtype=np.float32))
output_tensors = torch.matmul(input_tensor,other_tensor)
print(output_tensors)
System Information
- What is your OneFlow installation :dockerhub
- OS:Linux
- OneFlow version (run python3 -m oneflow --doctor):0.9.1.dev20231024+cu117
- Python version: 3.8
Sorry to bother, it's obvious that my issues are ignored, maybe some confirmation or attention needed. @levi131