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-loop-viewgit 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-loop-view)<a href="https://agentmods.dev/skills/mindspore-ai/akg/pypto-loop-view"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/pypto-loop-view/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-loop-view"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/pypto-loop-view.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.00043 | $0.01297 |
| Opus 5.5 | $0.00017 | $0.00519 |
| Sonnet 5.5 | $0.00009 | $0.00259 |
| Haiku 4.5 | $0.00004 | $0.00130 |
Grade A, and why
pypto-loop-view 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.
How it starts
The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Loop + View:编译期常量规则
致命错误:ValueError: Not concrete value
最常见的首次生成错误。所有 pypto.view 的 shape 参数必须是编译期常量(字面量或闭包变量)。
# WRONG — min() 含 loop 变量 offset,是运行时值
for idx in pypto.loop(0, num_iters, 1, ...):
offset = idx * BASIC_BATCH
current = min(BASIC_BATCH, total_size - offset) # runtime!
chunk = pypto.view(x, [current, n], [offset, 0]) # ValueError!
任何含 loop idx 的表达式都是运行时值,不能用于 view shape。
通用正确写法
方法 A:确保整除(推荐)
选择 BASIC_BATCH 使 total_size 可整除,或在 forward 中 assert 整除性:
def create_kernel(total_rows, cols, basic_batch):
assert total_rows % basic_batch == 0
num_iters = total_rows // basic_batch # 闭包常量
@pypto.frontend.jit(...)
def kernel(x: pypto.Tensor((total_rows, cols), ...)) -> ...:
output = pypto.tensor([total_rows, cols], pypto.DT_FP32)
pypto.set_vec_tile_shapes(1, 8192)
for idx in pypto.loop(0, num_iters, 1, name="LOOP", idx_name="idx"):
off = idx * basic_batch
chunk = pypto.view(x, [basic_batch, cols], [off, 0])
result_chunk = chunk * 2.0 # 示例操作
pypto.assemble(result_chunk, [off, 0], output)
return output
return kernel
class ModelNew(torch.nn.Module):
def forward(self, x):
total_rows = x.shape[0] * x.shape[1]
# 调参由 loop_count 空间驱动:先试 16/32,再反推 basic_batch
target_loop_count = 16
assert total_rows % target_loop_count == 0
basic_batch = total_rows // target_loop_count
...
方法 B:主循环 + 尾部
当无法保证整除时:
def create_kernel(total_rows, cols, basic_batch):
full_iterations = total_rows // basic_batch
tail = total_rows % basic_batch
tail_offset = full_iterations * basic_batch
# full_iterations, tail, tail_offset 都是闭包常量
@pypto.frontend.jit(...)
def kernel(x: pypto.Tensor((total_rows, cols), ...)) -> ...:
output = pypto.tensor([total_rows, cols], pypto.DT_FP32)
pypto.set_vec_tile_shapes(1, 8192)
for idx in pypto.loop(0, full_iterations, 1, name="LOOP", idx_name="idx"):
off = idx * basic_batch
chunk = pypto.view(x, [basic_batch, cols], [off, 0])
pypto.assemble(chunk * 2.0, [off, 0], output)
if tail > 0: # 编译期求值(tail 是闭包常量)
tail_chunk = pypto.view(x, [tail, cols], [tail_offset, 0])
pypto.assemble(tail_chunk * 2.0, [tail_offset, 0], output)
return output
return 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 · 124 lines · 43 tokens per session scan A 07ff79e832b3
pypto-loop-view is a skill published in the GitHub repository mindspore-ai/akg (269 stars, last pushed yesterday), licensed Apache-2.0. It adds 43 tokens to every session and 1,297 once invoked, about $0.0002 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-loop-view compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pypto-loop-viewmindspore-ai/akg | Skill | 269 | yesterday | Apache-2.0 | A | 43 | Claude Code, Codex |
| ai-loopsickn33/agentic-awesome-skills | Skill | 51k | today | MIT | A | 28 | Claude Code |
| software-implementationstencila/stencila | Skill | 916 | today | Apache-2.0 | A | 124 | Claude Code |
| project-executionathola/claude-night-market | Skill | 358 | yesterday | MIT | A | 31 | Claude Code |
| architecture-paradigmsathola/claude-night-market | Skill | 358 | yesterday | MIT | A | 27 | Claude Code |
| algolia-search-v2diegosouzapw/awesome-omni-skills | Skill | 181 | 4d ago | MIT | A | 50 | Claude Code, Codex |
| notion-spec-to-implementationseaworld008/Commonly-used-high-value-skills | Skill | 75 | 6d ago | MIT | A | 38 | Codex |