shuffle#
- deeptrack.backend.array_api_compat_ext.torch.random.shuffle(x: Tensor) None#
Shuffle a tensor in-place along the first axis.
Mirrors numpy.random.shuffle.
Parameters#
- x: torch.Tensor
Tensor to shuffle along the first axis.
Returns#
- None
The tensor is shuffled in-place.
Examples#
>>> from deeptrack.backend.array_api_compat_ext.torch import random as rnd
>>> import torch >>> >>> x = torch.tensor([1, 2, 3, 4]) >>> rnd.shuffle(x) >>> x tensor([2, 1, 3, 4])