Skip to content

to_dlpack for 循环报错 #50120

@joey12300

Description

@joey12300

bug描述 Describe the Bug

在for循环里单独调用paddle.utils.dlpack.to_dlpack会报错。代码如下:

 import paddle
 for i in range(2):
     data = paddle.randn([2, 5])
     pd_dlpack = paddle.utils.dlpack.to_dlpack(data)

执行上述代码,会出现下面的错误:

W0131 11:19:19.969352 54337 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 11.2
W0131 11:19:19.974011 54337 gpu_resources.cc:91] device: 0, cuDNN Version: 8.2.
Traceback (most recent call last):
  File "test_dlpack.py", line 4, in <module>
    for i in range(2):
ValueError: PyCapsule_GetPointer called with incorrect name

同样的代码 torch 不会报错。

其他补充信息 Additional Supplementary Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions