def get_patches_per_dimension(dimension: int, size: int, stride: int) -> int:
    """
    Returns the number of patches that can be created in the given dimension without going over
    the dimension bounds.
    """
    assert size % stride == 0

    overlapping = (size // stride) - 1 if stride != size else 0
    return (dimension // stride) - overlapping