oneflow
oneflow copied to clipboard
When nan/inf is a parameter of 'oneflow.linspace', there is a core dumped happen
Summary
When nan/inf is a parameter of 'oneflow.linspace', there is a core dumped happen, while pytorch/numpy doesn't.
Code to reproduce bug
import oneflow as flow
# Create a 1-D tensor with values evenly spaced from start to end
output_tensor = flow.linspace(start=0, end=float('nan'), steps=5)
# Print the output tensor
print("OneFlow Tensor:", output_tensor)
import torch
# Create a 1-D tensor with values evenly spaced from start to end
output_tensor = torch.linspace(start=0, end=float('inf'), steps=5)
# Print the output tensor
print("PyTorch Tensor:", output_tensor)
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
the same situation exists for 'oneflow.logspace'