fixed-tensor-testing

fixed-tensor-testing is a skill for Claude Code, Codex from cxcscmu/SkillLearnBench. It costs 16 tokens per session (1,167 once invoked), scanned A, original, MIT.

A guide to testing machine-learning functions with fixed PyTorch tensors, which are numerical arrays used by models. It uses fixed random seeds and inputs so repeated tests produce the same results.

In plain words
What is it for?
Use it to build repeatable tests for tensor calculations, sequence masks, padding, and model outputs.
Why use it?
It makes failures reproducible and lets you check loss functions or model outputs without running a full training process.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build repeatable tests for tensor calculations, sequence masks, padding, and model outputs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cxcscmu/skilllearnbench/fixed-tensor-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cxcscmu/SkillLearnBench --skill fixed-tensor-testing
Clone the repo
git clone --depth 1 https://github.com/cxcscmu/SkillLearnBench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fixed-tensor-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/fixed-tensor-testing/github.svg)](https://agentmods.dev/skills/cxcscmu/skilllearnbench/fixed-tensor-testing)
Your own site
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/fixed-tensor-testing"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/fixed-tensor-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fixed-tensor-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/fixed-tensor-testing"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/fixed-tensor-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,167 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00016 $0.01167
Opus 5.5 $0.00006 $0.00467
Sonnet 5.5 $0.00003 $0.00233
Haiku 4.5 $0.00002 $0.00117

Measured 1mo ago against content hash a5c96e6a83ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fixed-tensor-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/b1-one-shot-claude-haiku-4-5/nlp-paper-reproduction/fixed-tensor-testing/SKILL.md · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing with Fixed Input Tensors

Purpose

Fixed tensor testing ensures deterministic, reproducible results for loss functions and model outputs. Enables verification without training dependencies.

Creating Fixed Tensors

1. Deterministic Seeding

import torch
import numpy as np

# Set all random seeds
torch.manual_seed(42)
np.random.seed(42)
if torch.cuda.is_available():
    torch.cuda.manual_seed_all(42)

2. Creating Test Tensors

# Fixed log probabilities (typically negative)
log_probs = torch.randn(batch_size, seq_len)
# Ensure reasonable log prob range (e.g., -2 to 0)
log_probs = torch.clamp(log_probs, min=-5.0, max=0.0)

# Fixed sequence lengths
seq_lengths = torch.randint(10, 100, (batch_size,))

# Fixed input IDs (for masking)
input_ids = torch.randint(0, vocab_size, (batch_size, seq_len))

3. Example Test Setup

batch_size = 4
seq_len = 10

# Generate fixed tensors
torch.manual_seed(123)
log_probs = torch.randn(batch_size, seq_len)
log_probs = torch.clamp(log_probs, -5.0, 0.0)

# Create mask (e.g., padding)
mask = torch.ones(batch_size, seq_len, dtype=torch.bool)
mask[:, seq_len-2:] = False  # Last 2 tokens are padding

# Lengths accounting for mask
seq_lengths = mask.sum(dim=1).float()

Saving Test Results

Save as .npz (NumPy Compressed)

import numpy as np

results = {
    'losses': loss.cpu().detach().numpy(),
    'log_probs': log_probs.cpu().detach().numpy(),
}

np.savez_compressed('/path/to/results.npz', **results)

Load .npz Files

data = np.load('/path/to/results.npz')
losses = data['losses']
print(f"Shape: {losses.shape}, dtype: {losses.dtype}")

Assertions and Validation

Basic Checks

# Loss should be finite and positive
assert torch.isfinite(loss).all(), "Loss contains NaN or Inf"
assert loss.item() > 0, "Loss should be positive"

# Shape validation
assert loss.shape == expected_shape, f"Shape mismatch: {loss.shape}"

# Range checks
assert loss.item() < 100, "Loss unreasonably large"
assert log_probs.min() >= -6.0, "Log probs too small"

Read the full file on GitHub · 177 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 177 lines · 16 tokens per session scan A a5c96e6a83ec

Subscribe to this mod's changes

fixed-tensor-testing is a skill published in the GitHub repository cxcscmu/SkillLearnBench (88 stars, last pushed 17d ago), licensed MIT. It adds 16 tokens to every session and 1,167 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

data-quality-frameworks

Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts.

wshobson/agents · 37 tokens

dbt-transformation-patterns

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.

wshobson/agents · 47 tokens

agent-evals

Build automated evaluation suites for AI agents using golden datasets, rubrics, and regression gates. Use when shipping agent features, validating prompt changes, or gating deployments on quality.

sickn33/agentic-awesome-skills · 38 tokens

nemo-automodel-model-onboarding

Guide for onboarding new model architectures into NeMo AutoModel, including architecture discovery, implementation patterns, registration, and validation.

NVIDIA/skills · 33 tokens

nemo-automodel-recipe-development

Create and modify NeMo AutoModel training and evaluation recipes, including YAML structure, builders, and execution flow.

NVIDIA/skills · 31 tokens

testing-llm

LLM and AI testing patterns — mock responses, evaluation with DeepEval/RAGAS, structured output validation, and agentic test patterns (generator, healer, planner). Use when testing AI features, validating LLM outputs, or building evaluation pipelines.

yonatangross/orchestkit · 55 tokens