inspect
torch_to_nnef.nemo_tract.inspect
StageInputTransform
dataclass
StageInputTransform(skip: bool, new_shape: T.List[T.Union[int, str]], remap: dict[int, str], notes: T.List[str], bind_flag: T.Optional[str])
Result of applying stage transforms to a single input.
collect_signatures
collect_signatures(*, asr_model, inference_target, stage: Stage = Stage.RAW, skip_preprocessor: bool = False, split_joint_decoder: bool = False, float_dtype: T.Optional[torch.dtype] = None, only_subnets: T.Optional[T.Collection[str]] = None) -> T.List[SubnetSignature]
Collect per-subnet signatures without printing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asr_model |
NeMo model instance. |
required | |
inference_target |
Export target wrapper. |
required | |
stage |
Stage
|
Stage to collect (RAW, COLLAPSED, BOUND, FINAL semantics). |
RAW
|
skip_preprocessor |
bool
|
Whether to skip preprocessor subnet. |
False
|
split_joint_decoder |
bool
|
Whether to split joint/decoder. |
False
|
float_dtype |
Optional[dtype]
|
Preferred float dtype for examples. |
None
|
only_subnets |
Optional[Collection[str]]
|
Optional subset filter. |
None
|
Returns:
| Type | Description |
|---|---|
List[SubnetSignature]
|
List of SubnetSignature snapshots. |
run_inspection
run_inspection(*, asr_model, inference_target, skip_preprocessor: bool, split_joint_decoder: bool, float_dtype: torch.dtype, only_subnets: T.Optional[T.Collection[str]], stages: T.Optional[T.List[Stage]], fmt: InspectFormat, to_path: T.Optional[Path], diff: bool, axis_registry=None, model_label: T.Optional[str] = None) -> None
Run the inspection pipeline and print results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asr_model |
NeMo model instance. |
required | |
inference_target |
Export target wrapper. |
required | |
skip_preprocessor |
bool
|
Whether to skip preprocessor subnet. |
required |
split_joint_decoder |
bool
|
Whether to split joint/decoder. |
required |
float_dtype |
dtype
|
Preferred float dtype for examples. |
required |
only_subnets |
Optional[Collection[str]]
|
Optional subset filter. |
required |
stages |
Optional[List[Stage]]
|
Stages to display; defaults to FINAL. |
required |
fmt |
InspectFormat
|
Output format (human or json). |
required |
to_path |
Optional[Path]
|
Optional file path to write output. |
required |
diff |
bool
|
Whether to display diffs between unique signature groups. |
required |
axis_registry |
Optional registry to overlay symbolic axes for inputs. |
None
|
|
model_label |
Optional[str]
|
Optional model slug or local path for header/JSON. |
None
|