oneflow icon indicating copy to clipboard operation
oneflow copied to clipboard

When nan/inf is a parameter of 'oneflow.linspace', there is a core dumped happen

Open Redempt1onzzZZ opened this issue 1 year ago • 1 comments

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)

image

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)

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

Redempt1onzzZZ avatar Mar 28 '24 09:03 Redempt1onzzZZ

the same situation exists for 'oneflow.logspace'

Redempt1onzzZZ avatar Mar 28 '24 11:03 Redempt1onzzZZ