Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
if (workspace_size != 0) { \ at::TensorOptions options = at::TensorOptions(torch_npu::utils::get_npu_device_type()); \ auto workspace_tensor = at::empty({workspace_size}, options.dtype(at::kByte)); \ workspace_addr = const_cast<void*>(workspace_tensor.storage().data()); \ } 在if中如果代码块结束,会导致workspace_addr悬空。
不涉及
代码检视
代码逻辑正常,功能正常跑通
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
if (workspace_size != 0) { \
at::TensorOptions options = at::TensorOptions(torch_npu::utils::get_npu_device_type()); \
auto workspace_tensor = at::empty({workspace_size}, options.dtype(at::kByte)); \
workspace_addr = const_cast<void*>(workspace_tensor.storage().data()); \
}
在if中如果代码块结束,会导致workspace_addr悬空。
Environment / 环境信息 (Mandatory / 必填)
不涉及
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
代码检视
Describe the expected behavior / 预期结果 (Mandatory / 必填)
代码逻辑正常,功能正常跑通
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
代码检视
Special notes for this issue/备注 (Optional / 选填)