import torch


def _batch_concat_with_no_op(tensors):
    """If there is only one tensor to concatenate, this is a no-op."""
    if len(tensors) == 1:
        return tensors[0].detach()
    else:
        return torch.concat(tensors, dim=0).detach()