ivy.Container.static_shuffle
- ivy.Container.static_shuffle(x, /, *, seed=None, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]
ivy.Container static method variant of ivy.shuffle. This method simply wraps the function, and so the docstring for ivy.shuffle also applies to this method with minimal changes.
- Parameters
x (
Union
[int
,Container
,Array
,NativeArray
]) – Input array or container. Should have a numeric data type.seed (
Optional
[int
]) – A python integer. Used to create a random seed distribution (default:None
)key_chains (
Optional
[Union
[List
[str
],Dict
[str
,str
]]]) – The key-chains to apply or not apply the method to. Default isNone
. (default:None
)to_apply (
bool
) – If True, the method will be applied to key_chains, otherwise key_chains (default:True
) will be skipped. Default isTrue
.prune_unapplied (
bool
) – Whether to prune key_chains for which the function was not applied. (default:False
) Default isFalse
.map_sequences (
bool
) – Whether to also map method to sequences (lists, tuples). (default:False
) Default isFalse
.out (
Optional
[Container
]) – optional output container, for writing the result to. It must have a shape (default:None
) that the inputs broadcast to.
- Return type
- Returns
ret – A container object, shuffled along the first dimension.
Examples
>>> x = ivy.Container(a=ivy.array([7, 6, 0]), ... b=ivy.array([8, 9, 4])) >>> ivy.Container.static_shuffle(x) { a: ivy.array([7, 0, 6]), b: ivy.array([8, 4, 9]) }