sciai.utils.to_tupleο
- sciai.utils.to_tuple(data)[source]ο
Convert a given param into tuple if itβs not, otherwise keep it unchanged.
- Parameters
data (Union[tuple, list, any]) β A tuple or not tuple data.
- Returns
Tuple, Converted tuple representation of input data.
Examples
>>> from sciai.utils import to_tuple >>> a = 1 >>> a_tuple = to_tuple(a) >>> print(a_tuple) (1,)