def differentiable_polynomial_rounding(input: Tensor) -> Tensor:
    """Differentiable rounding.

    Args:
        input (Tensor): Input tensor of any shape to be rounded.

    Returns:
        output (Tensor): Pseudo rounded tensor of the same shape as input tensor.

    """
    # Perform differentiable rounding
    input_round = input.round()
    output: Tensor = input_round + (input - input_round) ** 3
    return output
Differentiable rounding.

    Args:
        input (Tensor): Input tensor of any shape to be rounded.

    Returns:
        output (Tensor): Pseudo rounded tensor of the same shape as input tensor.

    
kornia/utils/misc.py