| 标题 | pytorch pytorch (torch.jit.script) torch 2.6.0 Segmentation Fault |
|---|
| 描述 | # Bug
When using `@torch.jit.script` for TorchScript compilation, defining a scripted class (e.g., Ignored) where the `__init__` method includes a dynamic Python structure like list causes a `Segmentation fault` at runtime.
# To Reproduce
Running the following code results in a Segmentation fault:
```
import torch
import torch.nn as nn
@torch.jit.script
class Ignored(object):
def __init__(self):
self.count: int = 0
self.items: list = []
``` |
|---|
| 来源 | ⚠️ https://github.com/pytorch/pytorch/issues/149623 |
|---|
| 用户 | Default436352 (UID 81891) |
|---|
| 提交 | 2025-03-20 15時40分 (1 年前) |
|---|
| 管理 | 2025-03-30 19時42分 (10 days later) |
|---|
| 状态 | 已接受 |
|---|
| VulDB条目 | 302049 [PyTorch 2.6.0 torch.jit.script 内存损坏] |
|---|
| 积分 | 20 |
|---|