def _need_manual_broadcast(input1: np.ndarray, input2: np.ndarray) -> bool:
    """Check if the np auto broadcast can handle. If not, need manual broadcasting."""
    for axis, (dim1, dim2) in enumerate(zip(input1.shape, input2.shape)):
        if dim1 != dim2 and not (dim1 == 1 or dim2 == 1):
            return True
    return False
Check if the np auto broadcast can handle. If not, need manual broadcasting.
coremltools/optimize/_utils.py