import torch


def total_variation(paths: torch.Tensor) -> torch.Tensor:
    """Computes the total variation of a batch of multidimensional paths.

    :param paths: torch.Tensor of shape (batch_size, length, input_channels)
    :return: torch.Tensor of shape (batch_size)
    """
    paths_shifted = paths[:, 1:, :]
    return torch.sum(torch.norm(paths[:, :-1, :] - paths_shifted, dim=2), dim=1)