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

Function _as_list

backends/arm/quantizer/quantization_annotator.py:88–103  ·  view source on GitHub ↗

Return ``x`` wrapped as a list if needed. Args: x: Value or list of values. Returns: list: ``x`` if already a list; otherwise ``[x]``.

(x)

Source from the content-addressed store, hash-verified

86
87
88def _as_list(x):
89 """Return ``x`` wrapped as a list if needed.
90
91 Args:
92 x: Value or list of values.
93
94 Returns:
95 list: ``x`` if already a list; otherwise ``[x]``.
96
97 """
98 if isinstance(x, (list, tuple)):
99 return x
100 else:
101 return [
102 x,
103 ]
104
105
106def _adjust_weight_qspec_for_conv_transpose(

Callers 2

_is_ok_for_quantizationFunction · 0.85
_annotate_inputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected