import torch


def unsort(tensor: torch.Tensor, indices: torch.Tensor) -> torch.Tensor:
    """Unsort a tensor along dimension 0."""
    unsorted = tensor.new_empty(tensor.size())
    unsorted.scatter_(0, indices.unsqueeze(-1).expand_as(tensor), tensor)
    return unsorted