import torch


def dagger(x: torch.Tensor) -> torch.Tensor:
    """Conjugate transpose of a batch of matrices. Matrix dimensions are
    assumed to be the final two, with all preceding dimensions batched over."""
    return x.conj().transpose(-2, -1)