def get_target_shape(shape, size_factor):
    """
    Given an shape tuple and size_factor, return a new shape tuple such that each of its dimensions
    is a multiple of size_factor
    :param shape: tuple of integers
    :param size_factor: integer
    :return: tuple of integers
    """

    target_shape = []

    for dimension in shape:

        rounded_down_dimension = size_factor * (dimension // size_factor)
        rounded_up_dimension = rounded_down_dimension + size_factor

        rounded_down_difference = abs(dimension - rounded_down_dimension)
        rounded_up_difference = abs(dimension - rounded_up_dimension)

        target_dimension = \
            rounded_down_dimension if rounded_down_difference <= rounded_up_difference else rounded_up_dimension

        target_shape.append(target_dimension)

    return tuple(target_shape)