def _maybe_cast_bool_x_and_values_for_coreml_scatter(x: Var, values: Var) -> Tuple[Var]:
        """
        Core ML `scatter_nd` op does not support bool for data/updates,
        so we need to cast them to int32.
        """
        if types.is_bool(x.dtype):
            x = mb.cast(x=x, dtype="int32")
        if types.is_bool(values.dtype):
            values = mb.cast(x=values, dtype="int32")
        return x, values

        Core ML `scatter_nd` op does not support bool for data/updates,
        so we need to cast them to int32.
        
coremltools/converters/mil/frontend/torch/ops.py