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)
| 86 | |
| 87 | |
| 88 | def _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 | |
| 106 | def _adjust_weight_qspec_for_conv_transpose( |
no outgoing calls
no test coverage detected