$npx skillfedfor your agent

pytorch-seed

RNG seeding and context management for pytorch

With conditionsPyPI Artificial IntelligenceReleased Feb 2023124.1K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytorch_seed-0.2.0-py3-none-any.whl
v0.2.0 · released 2023-02-15 · Python >=3.6 · 2 runtime deps: torch, numpy

Yes, if you need simple, unified RNG seeding for PyTorch and are comfortable with an abandoned package. The code is straightforward and unlikely to break with minor PyTorch updates, but you should test it with your specific PyTorch version and consider forking if you need future fixes. For active projects requiring long-term support, evaluate whether PyTorch Lightning's seed utilities or manual seeding better fits your needs.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires PyTorch 1.0+ and Python 3.6+.
  • CUDA RNG seeding only works if CUDA is available.
  • Low friction install with only torch and numpy as runtime dependencies.

License · maintenance · safety

permissive license (permissive) — MIT license (permissive). You can use, modify, and distribute this package freely in commercial or private projects, with no warranty and no liability on the authors.

last release 2023-02-15 (1276 days) · last repo commit 2023-02-15 · 2 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 124,120 downloads/mo, #11,885 on PyPI

Verify before relying

pip install pytorch-seed

import pytorch_seed
pytorch_seed.seed(123)  # Seeds Python, NumPy, torch CPU, and all CUDA RNGs

# Or use SavedRNG context manager to isolate RNG state:
with pytorch_seed.SavedRNG():
    result = torch.rand(1)  # Does not affect global RNG
  • Whether SavedRNG correctly handles all edge cases with newer PyTorch versions (package is abandoned since 2023-02-15).
  • Compatibility with PyTorch versions released after the package's last update.
Same gist for agents: .md · .json

What it is and what it does

pytorch-seed is a lightweight utility for reproducible random number generation in PyTorch projects. It provides a single `seed()` function that simultaneously seeds Python's base RNG, NumPy's RNG, PyTorch's CPU RNG, and all CUDA RNGs—ensuring deterministic behavior across the entire stack. It also offers a `SavedRNG` context manager that lets you temporarily isolate RNG state, either to run code without affecting the global RNG or to maintain independent RNG streams that resume from where they left off.

The package is designed for researchers and practitioners who need reproducible training runs or experiments. Its API mirrors PyTorch Lightning's seeding utilities, making it familiar to users of that ecosystem. Installation is straightforward with only torch and numpy as dependencies, but note that the project is abandoned as of 2023-02-15 with no active maintenance.

Use it for

  • Seed all RNGs at the start of a training script to ensure reproducible model initialization and data shuffling across runs.
  • Use SavedRNG context manager to run stochastic operations (e.g., data augmentation) without affecting the main training RNG stream.
  • Maintain separate RNG streams for different parts of an experiment (e.g., one for data generation, one for model dropout) that evolve independently.
  • Verify that two seeded runs produce identical random sequences to validate experiment reproducibility.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need simple, unified RNG seeding for PyTorch and are comfortable with an abandoned package.

The code is straightforward and unlikely to break with minor PyTorch updates, but you should test it with your specific PyTorch version and consider forking if you need future fixes. For active projects requiring long-term support, evaluate whether PyTorch Lightning's seed utilities or manual seeding better fits your needs.

Install

pytorch-seed on PyPI

Before you install

Low friction install with only torch and numpy as runtime dependencies. However, the package is abandoned—last release was 2023-02-15 with no updates since, and the repository shows minimal activity (2 stars). Use only if you need this specific seeding pattern and are comfortable maintaining a fork if issues arise.

Requires PyTorch 1.0+ and Python 3.6+. CUDA RNG seeding only works if CUDA is available.

License in practice

MIT license (permissive). You can use, modify, and distribute this package freely in commercial or private projects, with no warranty and no liability on the authors.

Quickstart

pip install pytorch-seed

import pytorch_seed
pytorch_seed.seed(123)  # Seeds Python, NumPy, torch CPU, and all CUDA RNGs

# Or use SavedRNG context manager to isolate RNG state:
with pytorch_seed.SavedRNG():
    result = torch.rand(1)  # Does not affect global RNG

Verify before relying

  • Whether SavedRNG correctly handles all edge cases with newer PyTorch versions (package is abandoned since 2023-02-15).
  • Compatibility with PyTorch versions released after the package's last update.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.6
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
torchnumpy
MaintenanceAbandoned 1,276 days since the last release
Last repo commit
First released
Downloads124,120 / month, #11,885 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

Evidence: pytorch_seed-0.2.0-py3-none-any.whl

Tags

Capabilities
pytorch reproducible seedingtorch rng seed everythingpytorch random state managementdeterministic pytorch trainingtorch cuda rng controlpytorch reproducibility utilities
Topics
reproducibilityrng-seeding
PyPI keywords
rngpytorchseedingreproducibility

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pytorch reproducible seeding”

  • pytorch-seedProvides reproducible random number generation for PyTorch by seeding…
  • arm-pytorch-utilitiesProvides utility functions for PyTorch development, including random…
  • snowfakerySnowfakery generates fake relational data from YAML recipes, writing…

Give your agent the search over MCP, or paste the wish link into any chat.

More Artificial Intelligence packages

litellm With conditions
PyPI · Artificial Intelligence · released Aug 2026

LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.

Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.

MITcompiled wheel
682.8Mdownloads / mo
huggingface-hub Worth it
PyPI · Artificial Intelligence · released Aug 2026

Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.

Install it if you work with Hugging Face Hub models or datasets.

Apache-2.0pure Python · 3.10.0+
442.4Mdownloads / mo
langchain Worth it
PyPI · Python Modules · released Aug 2026

LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.

MITpure Python
315.4Mdownloads / mo
hf-xet With conditions
PyPI · Artificial Intelligence · released Aug 2026

hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.

Apache-2.0compiled wheel · 3.8+
258.4Mdownloads / mo
tokenizers Worth it
PyPI · Artificial Intelligence · released Apr 2026

Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.

Apache-2.0compiled wheel · 3.10+
222.9Mdownloads / mo
transformers Worth it
PyPI · Artificial Intelligence · released Aug 2026

Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.

Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.

permissive licensepure Python · 3.10.0+
186.6Mdownloads / mo

See also arm-pytorch-utilities · pytest-rng · torch · nvidia-curand · cuequivariance-ops-torch-cu12 · random2 · lovely-tensors · torch-audiomentations · pytorch · torchcodec

Further reading