Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oneflow.matmul doesn't work for this situation #10481

Open
Redmept1on opened this issue Apr 1, 2024 · 0 comments
Open

oneflow.matmul doesn't work for this situation #10481

Redmept1on opened this issue Apr 1, 2024 · 0 comments
Labels
bug community events from community

Comments

@Redmept1on
Copy link

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)

image

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)

image

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
@Redmept1on Redmept1on added bug community events from community labels Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug community events from community
Projects
None yet
Development

No branches or pull requests

1 participant