MCPcopy Create free account
hub / github.com/pytorch/executorch / _validate

Method _validate

backends/arm/vgf/compile_spec.py:45–60  ·  view source on GitHub ↗

Validate the configuration against VGF-supported TOSA profiles.

(self)

Source from the content-addressed store, hash-verified

43 self._validate()
44
45 def _validate(self):
46 """Validate the configuration against VGF-supported TOSA profiles."""
47 tosa_version = self.tosa_spec.version # type: ignore[attr-defined]
48 tosa_profiles = self.tosa_spec.profiles # type: ignore[attr-defined]
49
50 if tosa_version.major != 1:
51 raise ValueError(
52 "Arm backend only supports converter-backend for TOSA version 1. "
53 f"Invalid TOSA version: {tosa_version}"
54 )
55
56 if "FP" not in tosa_profiles and "INT" not in tosa_profiles:
57 raise ValueError(
58 "Arm backend only supports converter-backend for FP and/or INT. "
59 f"Invalid TOSA profile: {tosa_profiles}"
60 )
61
62 @classmethod
63 def _get_output_format(cls) -> str:

Callers 8

__init__Method · 0.95
_Function · 0.45
duplicate_constant_nodeFunction · 0.45
serializeMethod · 0.45
remove_assertsFunction · 0.45

Calls

no outgoing calls

Tested by 1