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.
npx skills add mindspore-ai/akg --skill pypto-case-loss-crossentropygit clone --depth 1 https://github.com/mindspore-ai/akgWrote 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.
[](https://agentmods.dev/skills/mindspore-ai/akg/pypto-case-loss-crossentropy)<a href="https://agentmods.dev/skills/mindspore-ai/akg/pypto-case-loss-crossentropy"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/pypto-case-loss-crossentropy/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.
<a href="https://agentmods.dev/skills/mindspore-ai/akg/pypto-case-loss-crossentropy"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/pypto-case-loss-crossentropy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00037 | $0.00524 |
| Opus 5.5 | $0.00015 | $0.00210 |
| Sonnet 5.5 | $0.00007 | $0.00105 |
| Haiku 4.5 | $0.00004 | $0.00052 |
Grade A, and why
pypto-case-loss-crossentropy 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 3mo 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.
What it actually says
模式 D:Loss — CrossEntropyLoss
def create_cross_entropy_kernel(batch, num_classes):
@pypto.frontend.jit(runtime_options=..., debug_options=...)
def kernel(
predictions: pypto.Tensor((batch, num_classes), pypto.DT_FP32),
targets: pypto.Tensor((batch,), pypto.DT_INT64),
) -> pypto.Tensor((1,), pypto.DT_FP32):
output = pypto.tensor([1], pypto.DT_FP32)
# Phase 1: per-sample softmax + gather
pypto.set_vec_tile_shapes(1024, 16)
log_probs = pypto.log(pypto.softmax(predictions, dim=1))
targets_i32 = pypto.cast(targets, pypto.DT_INT32)
idx = pypto.unsqueeze(targets_i32, 1)
picked = pypto.gather(log_probs, dim=1, index=idx)
neg_picked = pypto.mul(picked, -1.0)
# Phase 2: batch reduction
pypto.set_vec_tile_shapes(2048, 8)
total = pypto.sum(neg_picked, dim=0, keepdim=False)
output[:] = total / batch
return output
return kernel
forward:assert → contiguous → 调 kernel → reshape(1,)
模式要点
- 两段 tile:不同计算阶段用不同 tile 配置
pypto.cast(targets, DT_INT32)— INT64 输入需转 INT32pypto.unsqueeze+pypto.gather— 按 index 取元素pypto.mul(x, -1.0)— 取反的标准写法(规则 R2 的应用)- 标量输出:
pypto.tensor([1], ...)+output[:] = scalar - 逐元素 loss(MSE/Huber 等)更简单:所有输入
reshape(-1)用 1D kernel
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.
- 3mo ago First seen · 46 lines · 37 tokens per session scan A 19d8f43ca898
pypto-case-loss-crossentropy is a skill published in the GitHub repository mindspore-ai/akg (269 stars, last pushed today), licensed Apache-2.0. It adds 37 tokens to every session and 524 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.
pypto-case-loss-crossentropy compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pypto-case-loss-crossentropymindspore-ai/akg | Skill | 269 | today | Apache-2.0 | A | 37 | Claude Code, Codex |
| torchdrugK-Dense-AI/scientific-agent-skills | Skill | 59k | 3d ago | MIT | A | 64 | Claude Code |
| arboretoK-Dense-AI/scientific-agent-skills | Skill | 59k | 3d ago | MIT | A | 55 | Claude Code, Codex |
| deepspot-mK-Dense-AI/scientific-agent-skills | Skill | 59k | 3d ago | MIT | A | 70 | Claude Code |
| pyhealthK-Dense-AI/scientific-agent-skills | Skill | 59k | 3d ago | MIT | A | 84 | Claude Code, Codex |
| nemo-mbridge-perf-expert-parallel-overlapNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 56 | Claude Code |
| tao-validate-recipe-transferNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 179 | Claude Code |