import torch


def btranspose(tensor: torch.Tensor) -> torch.Tensor:
    """Batch-wise transpose. Assumes that tensor has dimension of 3: [batch, features, samples]"""
    if tensor.dim() != 3:
        raise ValueError("The given shape is not supported.")

    return torch.transpose(tensor, 1, 2)