def _check_reduce_op(reduce_op: Operation, mode: str = "reduce_mean") -> bool:
        """
		Check whether or not the ``reduction`` op satisfies following conditions:

			- Mode is expected.
			- Does not change rank (``keep_dims`` is ``True``).
			- The ``axes`` is known at compile time.

		Parameters
		----------

		param reduce_op : ``reduce_op`` to check on.

		param mode : ``reduce`` mode

        """
        if reduce_op is None:
            return False
        if reduce_op.op_type != mode:
            return False
        if reduce_op.keep_dims is None or reduce_op.keep_dims.val is None:
            return False
        if reduce_op.keep_dims.val is False:
            return False
        if reduce_op.axes is None or reduce_op.axes.val is None:
            return False
        return True

		Check whether or not the ``reduction`` op satisfies following conditions:

			- Mode is expected.
			- Does not change rank (``keep_dims`` is ``True``).
			- The ``axes`` is known at compile time.

		Parameters
		----------

		param reduce_op : ``reduce_op`` to check on.

		param mode : ``reduce`` mode

        
coremltools/converters/mil/mil/passes/defs/optimize_normalization.py