import torch


def torch_unsqueeze_r(input: torch.Tensor, n: int):
    """
    Add n new axis to the right.

    eg. a tensor with shape (2, 3) passed to this function
        with n=2 will input in an output shape of (2, 3, 1, 1)
    """
    assert n >= 0, f'number of new axis cannot be less than zero, given: {repr(n)}'
    return input[(...,) + ((None,)*n)]