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

Wrong output when inf is the step in 'oneflow.arange' #10454

Open
Redmept1on opened this issue Mar 28, 2024 · 0 comments
Open

Wrong output when inf is the step in 'oneflow.arange' #10454

Redmept1on opened this issue Mar 28, 2024 · 0 comments
Labels
bug community events from community

Comments

@Redmept1on
Copy link

Summary

According to arange's calculation method (Generate numbers in the half open interval [start, stop)), when step is inf, the generated array should contain the start value, but oneflow.arange did not achieve this. And according to the documentation, all three arguments should be integers, but when I set them to numbers of type float, there are no errors

Code to reproduce bug

import oneflow as flow
import numpy as np

start=0.1
end=2
step=float('inf')

# oneflow
oneflow_range = flow.arange(start, end, step)
print("OneFlow:", oneflow_range)

#numpy
np_range = np.arange(start, end, step)
print('numpy:', np_range)

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 Mar 28, 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