import torch


def round(input, n_digits=0):
    """
    Returns a new tensor with the rounded to n decimal places version of the elements of the input.

    Args:
        input (`torch.FloatTensor`): input_tensor.
        n_digits (int, optional): number of digits. Defaults to 0.

    Returns:
        (`torch.FloatTensor`): output tensor.
    """
    return torch.round(input * 10 ** n_digits) / (10 ** n_digits)