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

Function require_static_int

backends/mlx/ops.py:165–180  ·  view source on GitHub ↗

Validate that a parameter is a static integer (not a Slot/SymInt). Raises NotImplementedError if the value is dynamic. Args: value: The parameter value to check param_name: Name of the parameter (for error message) op_name: Name of the operation (for error mess

(value: Any, param_name: str, op_name: str)

Source from the content-addressed store, hash-verified

163
164
165def require_static_int(value: Any, param_name: str, op_name: str) -> None:
166 """
167 Validate that a parameter is a static integer (not a Slot/SymInt).
168
169 Raises NotImplementedError if the value is dynamic.
170
171 Args:
172 value: The parameter value to check
173 param_name: Name of the parameter (for error message)
174 op_name: Name of the operation (for error message)
175 """
176 if isinstance(value, Slot) or not isinstance(value, int):
177 raise NotImplementedError(
178 f"{op_name} with dynamic {param_name} is not supported. "
179 f"{param_name} requires a static int32 value, but got {value} (type={type(value).__name__})."
180 )
181
182
183def require_static_float(value: Any, param_name: str, op_name: str) -> None:

Callers 3

require_static_intsFunction · 0.85
_slice_handlerFunction · 0.85
_slice_scatter_handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected