8000 `Segmentation fault` in `torch.nn.utils.rnn.pad_packed_sequence` and `torch.nn.utils.rnn.unpack_sequence` · Issue #149622 · pytorch/pytorch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Segmentation fault in torch.nn.utils.rnn.pad_packed_sequence and torch.nn.utils.rnn.unpack_sequence #149622
Open
@vwrewsge

Description

@vwrewsge

🐛 Describe the bug

Bug Code 1:

import torch
from torch.nn.utils.rnn import pad_packed_sequence, PackedSequence

empty_data = torch.randn(0, 5)
empty_batch_sizes = torch.tensor([], dtype=torch.int64)
empty_packed = PackedSequence(empty_data, empty_batch_sizes, None, None)
pad_packed_sequence(empty_packed, batch_first=True)

Output for Bug Code 1:

Segmentation fault

Bug Code 2:

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)

Output for Bug Code 2:

Segmentation fault

Versions

torch 2.6.0

cc @malfet

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: crashProblem manifests as a hard crash, as opposed to a RuntimeErrormodule: empty tensormodule: error checkingBugs related to incorrect/lacking error checkingtopic: fuzzertriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0