Pytorch Torch Msort
# PyTorch torch.msort Function
* * PyTorch torch Reference Manual](#)
`torch.msort` is a PyTorch function that returns a sorted tensor. It returns a copy of the input tensor sorted in ascending order, similar to flattening the tensor, sorting, then reshaping.
### Function Definition
torch.msort(input)
* * *
## Example Usage
## Example
import torch
# Create tensor
x = torch.tensor([3,1,2])
# Return sorted tensor
result = torch.msort(x)
print(result)
Output:
tensor([1, 2, 3])
* * PyTorch torch Reference Manual](#)
YouTip