| 标题 | pytorch pytorch (torch.nn.utils.rnn.unpack_sequence) torch 2.6.0 Segmentation fault |
|---|
| 描述 | # Bug Description
Calling `unpack_sequence` on an empty PackedSequence leads to a segmentation fault.
# Reproduction Steps
Run the following code:
```
import torch
from torch.nn.utils.rnn import PackedSequence, unpack_sequence
empty_data = torch.tensor([])
empty_batch_sizes = torch.tensor([], dtype=torch.int64)
packed = PackedSequence(data=empty_data, batch_sizes=empty_batch_sizes)
unpack_sequence(packed)
```
# Observed Behavior
The program crashes with a segmentation fault, indicating an invalid memory access. |
|---|
| 来源 | ⚠️ https://github.com/pytorch/pytorch/issues/149622 |
|---|
| 用户 | Default436352 (UID 81891) |
|---|
| 提交 | 2025-03-20 15時43分 (1 年前) |
|---|
| 管理 | 2025-03-30 19時42分 (10 days later) |
|---|
| 状态 | 已接受 |
|---|
| VulDB条目 | 302048 [PyTorch 2.6.0 torch.nn.utils.rnn.unpack_sequence 内存损坏] |
|---|
| 积分 | 20 |
|---|