Saltar al contenido
Nuevo

DeepSeek V4.1 Flash gratis por 7 días: 10M tokens al día tras una recarga de $10 o más. Hasta el 30/11.

Cómo funciona
aeondave/pytorchIA, agentes y MCP

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 instalaciones+3 en 7 días39 Estrellassincronizado hace 10 horas

Instalar

¿Aún no tienes la CLI de NotHoly? Instálala primero.

$ curl -fsSL https://notholy.com/install.sh | sh
$ notholy skills install aeondave/pytorch

Escribe en ⁦~/.notholy/skills⁩ después de comprobar la firma y el SHA-256.

FirmaFirmado, ed25519
sA8WD86VxY…BDe4l7DQ==La CLI comprueba el SHA-256 y la firma antes de escribir cualquier archivo.
Paquetecc041619…7f3139cc
cc0416198228…d1d17f3139cc1 archivo · ⁦1.8 KB⁩
EscaneoMedio2 hallazgos
  • No se encontró licencia
  • Enlaces a dominios externos
Ver el escaneo completo
Fuentegithub.com/AeonDave/malskill/tree/main/ai/pytorch@21cd568

Esta entrada todavía no está escrita en tu idioma, así que aparece en English.

Use PyTorch when model artifacts are tensors first and everything else second.

When to use PyTorch

Use PyTorch when you need to:

  • load .pt or .pth checkpoints safely onto CPU or GPU
  • inspect state_dict keys, 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.

python
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

python
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

python
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

python
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.) raise WeightsUnpickler error: Unsupported global: GLOBAL ... — review the required types and their code before explicitly allowlisting only those you trust:
python
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() and torch.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.load uses 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.

Archivos de esta versión

Permisos

PermisoDeclaradoHallado en el escaneo
Lee archivosNoNo
Escribe archivosNoNo
Ejecuta comandos de shellNoNo
Usa la redSíSí
Usa conectoresNoNo
Controla un navegadorNoNo

Hallazgos del escaneo

Revisado el 13 nov 2026

  1. MediaLicencia · No se encontró licencia
  2. InfoEnlace · Enlaces a dominios externos

Un escaneo limpio baja el riesgo, pero no prueba que el paquete sea seguro. Lee lo que instalas.

VersiónPublicadaCommitSHA-256FirmaCambio de permisos
v2026.11.13-21cd56813 nov 202621cd568cc041619Firmada–

Pregunta todo lo que tu alcance permite.

Crea la cuenta, añade créditos y haz la primera pregunta en el chat o en la terminal.

  1. 1/3

    Crea la cuenta

    Individual o empresa. Puedes pasar a empresa después sin perder saldo ni claves.

    IndividualEmpresa
  2. 2/3

    Añade créditos

    Con tarjeta. Pagas por token, sin suscripción.

    $5.00recarga mínima
  3. 3/3

    Pregunta

    En el chat, o instala el CLI y ejecuta notholy login en tu terminal.

    $ notholy login