Skip to content

paddle.arange with end=float('inf') on GPU causes memory leak #73668

@rookieLiu2018

Description

@rookieLiu2018

bug描述 Describe the Bug

When calling paddle.arange with end set to positive infinity on GPU, the operation never terminates and continually allocates memory until the system crashes. On CPU the same code returns an empty tensor without error.

import paddle
paddle.set_device('gpu')
start = paddle.to_tensor(0)
end = paddle.to_tensor(float('inf'))
a = paddle.arange(start,end,1, dtype=paddle.int32)
print(a)

The result on the CPU:

Tensor(shape=[0], dtype=int32, place=Place(cpu), stop_gradient=True,
       [])

I think both outcomes are incorrect, the input should be validated.

其他补充信息 Additional Supplementary Information

Version: paddlepaddle-gpu 3.0.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions