model-schema-validation

Installation
SKILL.md

Skill: Model Schema Validation Guide

Use this guide to define and enforce structural constraints (shapes, data types, runtime constraints) on loaded ExecuTorch .pte models using validateSpec.


🔍 Why Validate Model Specs?

Every ExecuTorch model exposes a schema (ModelSpec<ConcreteDim>), derived either from standard ExecuTorch MethodMeta at load time or from an exported get_model_schema companion method returning a JSON model spec.

To prevent runtime crashes, type mismatches, and memory allocation errors in C++, TypeScript task pipelines validate the loaded model's exported schema against allowed spec variants using validateSpec before allocating static tensors or executing inference.


🛠️ Validation API Reference

Installs
2
GitHub Stars
1.8K
First Seen
Oct 25, 2026
Security Audits