pytorch
PyTorch model inspection and checkpoint workflow for loading tensors, `state_dict` data, modules, and parameters. Use when working with `.pt` or `.pth` artifacts, auditing model structure, extracting weights, or scripting inference-oriented inspection of deep-learning checkpoints.
v2026.11.13-21cd5683 התקנות+3 ב-7 ימים39 כוכביםסונכרן לפני 10 שעות
התקנה
עדיין אין לכם את ה-CLI של NotHoly? התקינו אותו קודם.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install aeondave/pytorchנכתב אל ~/.notholy/skills אחרי בדיקת החתימה וה-SHA-256.
חתימהחתום, ed25519
חבילהcc041619…7f3139cc
cc0416198228…d1d17f3139ccקובץ אחד · 1.8 KBסריקהבינונישני ממצאים
- לא נמצא רישיון
- קישורים לדומיינים חיצוניים
מקורgithub.com/AeonDave/malskill/tree/main/ai/pytorch@21cd568
הפריט הזה עדיין לא נכתב בעברית, ולכן הוא מוצג בשפה אחרת: English.
בעמוד הזה
Use PyTorch when model artifacts are tensors first and everything else second.
When to use PyTorch
Use PyTorch when you need to:
- load
.ptor.pthcheckpoints safely onto CPU or GPU - inspect
state_dictkeys, module hierarchy, and parameter shapes - switch a model into stable inference mode for probing
- script quick tensor statistics or output checks against a checkpoint
Quick Start
Use a disposable, resource-limited environment for untrusted artifacts; restricted loading is not a sandbox or a guarantee against parser vulnerabilities.
import torch
checkpoint = torch.load("model.pt", map_location="cpu", weights_only=True)
print(type(checkpoint))
print(checkpoint.keys() if isinstance(checkpoint, dict) else "non-dict checkpoint")High-Value Workflows
Inspect a state dict
state = torch.load("weights.pth", map_location="cpu", weights_only=True)
for name, tensor in state.items():
print(name, tuple(tensor.shape), tensor.dtype)Inspect a loaded model
model.eval()
for name, module in model.named_modules():
print(name, module.__class__.__name__)
for name, param in model.named_parameters():
print(name, tuple(param.shape))Safe inference baseline
model.eval()
with torch.no_grad():
output = model(sample_input)Practical Notes
- Use
map_location="cpu"first unless you explicitly need GPU execution. - Prefer
state_dict-style loading and inspection over whole-model pickle blobs when possible. - PyTorch ≥ 2.6 defaults
torch.load(weights_only=True). State-dicts referencing extra globals (NumPy reconstructors, torchvision classes,omegaconf.ListConfig, etc.) raiseWeightsUnpickler error: Unsupported global: GLOBAL ...— review the required types and their code before explicitly allowlisting only those you trust:
import torch
from torch.serialization import add_safe_globals, safe_globals
import numpy as np
add_safe_globals([np.core.multiarray._reconstruct]) # process-wide
# or scope it:
with safe_globals([np.core.multiarray._reconstruct]):
state = torch.load("weights.pth", map_location="cpu", weights_only=True) Pass weights_only=False only when the file is trusted — it re-enables arbitrary code execution via pickle. Prefer safetensors (safetensors.torch.load_file) when available to avoid pickle object construction; untrusted files still require parser/version checks and isolation.
eval()andtorch.no_grad()belong together for stable inspection and reduced memory noise.- For structural inspection without materializing tensors, load under
torch._subclasses.fake_tensor.FakeTensorMode— gives shape/dtype/stride from the checkpoint without allocating memory.
Caveats
torch.loaduses pickle under the hood; do not trust untrusted checkpoint files.- Whole-model checkpoints require the original class code to be importable.
- Version drift can break deserialization or subtly alter behavior.
Resources
No bundled scripts/, references/, or assets/.
Use the official torch.load documentation for restricted loading and version-specific behavior; check matching docs for module introspection and checkpoint APIs.
הקבצים בגרסה הזו
- SKILL.md3.7 KB
הרשאות
| הרשאה | הוצהר | נמצא בסריקה |
|---|---|---|
| קורא קבצים | לא | לא |
| כותב קבצים | לא | לא |
| מריץ פקודות shell | לא | לא |
| משתמש ברשת | כן | כן |
| משתמש במחברים | לא | לא |
| שולט בדפדפן | לא | לא |
ממצאי הסריקה
נבדק ב-13 בנוב׳ 2026
- בינוניתרישיון · לא נמצא רישיון
- מידעקישור · קישורים לדומיינים חיצוניים
סריקה נקייה מורידה את הסיכון, אבל לא מוכיחה שהחבילה בטוחה. כדאי לקרוא מה מתקינים.
| גרסה | פורסמה | Commit | SHA-256 | חתימה | שינוי בהרשאות |
|---|---|---|---|---|---|
| v2026.11.13-21cd568 | 13 בנוב׳ 2026 | 21cd568 | cc041619 | חתומה | – |
עוד מ-AeonDave
הכול מהמפרסם הזהעוד בקטגוריה AI, סוכנים ו-MCP
לקטגוריה- fal-assetsrehan-remade/fal-assets5
- ai-system-prompt-leakagenoorqureshi/ai-system-prompt-leakage4
- ai-prompt-injectionnoorqureshi/ai-prompt-injection4
- testing-prompt-injection-in-rag-pipelinesmukul975/testing-prompt-injection-in-rag-pipelines4
- implementing-llm-guardrails-for-securitymukul975/implementing-llm-guardrails-for-security4
- defending-llms-with-guardrailsmukul975/defending-llms-with-guardrails4
שאלו כל מה שהסקופ מאפשר.
יוצרים חשבון, מוסיפים קרדיטים ושואלים את השאלה הראשונה בצ׳אט או בטרמינל.
- 1/3
יצירת חשבון
פרטי או חברה. אפשר לעבור לחשבון חברה אחר כך בלי לאבד יתרה או מפתחות.
פרטיחברה - 2/3
הוספת קרדיטים
בכרטיס אשראי. תשלום לפי טוקן, בלי מנוי.
$5.00טעינה מינימלית - 3/3
שאלה ראשונה
בצ׳אט, או להתקין את ה-CLI ולהריץ notholy login בטרמינל.
$ notholy login