def _maybe_handle_bool_mask(indices: List[Var]) -> List[Var]:
        """
        Bool mask is equivalent to int index
        Ex:
            a = torch.rand(4,5)
            index_1 = [True, True, False, False]
            index_2 = [False, True, True, False, False]
            b = a[index_1, index_2]

            indices is a list [[True, True, False, False], [False, True, True, False, False]]

            In this case, index_1 and index_2 are interpreted as mask by indices of True,
            index_1 -> [0, 1]
            index_2 -> [1, 2]

            b has shape (2,),
            where b[0] = a[0, 1] and b[1] = a[1, 2]

        So we create equivalent int index from bool mask,
        then let general pure int index selection handle the rest
        """
        int_indices = []
        for index in indices:
            if index is not None and types.is_bool(index.dtype):
                index = mb.non_zero(x=index)
                index = mb.squeeze(x=index, axes=[1])
            int_indices.append(index)
        return int_indices

        Bool mask is equivalent to int index
        Ex:
            a = torch.rand(4,5)
            index_1 = [True, True, False, False]
            index_2 = [False, True, True, False, False]
            b = a[index_1, index_2]

            indices is a list [[True, True, False, False], [False, True, True, False, False]]

            In this case, index_1 and index_2 are interpreted as mask by indices of True,
            index_1 -> [0, 1]
            index_2 -> [1, 2]

            b has shape (2,),
            where b[0] = a[0, 1] and b[1] = a[1, 2]

        So we create equivalent int index from bool mask,
        then let general pure int index selection handle the rest
        
coremltools/converters/mil/frontend/torch/ops.py