import torch


def add_dims_right(tensor, ndims, right_indent=0):
    """ Add empty dimensions to the right of tensor shape
    """
    assert right_indent >= 0
    for i in range(ndims):
        tensor = torch.unsqueeze(tensor, -1-right_indent)
    return tensor