def preprocess_batch_norm_params():
        """
        Before iOS17, the params needed to have the same dtype as input, we can just
        cast them to the same dtype as the input.
        Since iOS17, the batch_norm op allows params to have different dtypes from
        input, but the params themselves need to have the same dtype.
        """
        nonlocal running_mean, running_var, weight, bias, eps
        batch_norm_params = [running_mean, running_var, weight, bias, eps]
        if is_current_opset_version_compatible_with(target.iOS17):
            running_mean, running_var, weight, bias, eps = promote_input_dtypes(batch_norm_params)
        else:
            new_params = []
            for batch_norm_param in batch_norm_params:
                if batch_norm_param.dtype != _input.dtype:
                    batch_norm_param = mb.cast(
                        x=batch_norm_param, dtype=types.builtin_to_string(_input.dtype)
                    )
                new_params.append(batch_norm_param)
            running_mean, running_var, weight, bias, eps = new_params

        Before iOS17, the params needed to have the same dtype as input, we can just
        cast them to the same dtype as the input.
        Since iOS17, the batch_norm op allows params to have different dtypes from
        input, but the params themselves need to have the same dtype.
        
coremltools/converters/mil/frontend/torch/ops.py