import torch


def round(tensor, decimal_places):
    """
    Round floats to the given number of decimal places.

    :param tensor: input tensor
    :type tensor: torch.Tensor
    :param decimal_places: number of decimal places
    :types decimal_places: int
    :return: rounded tensor
    :rtype: torch.Tensor
    """

    factor = 10**decimal_places
    return torch.round(tensor*factor)/factor