# Path: tensorflow_model_remediation/common/docs.py
# def _no_op_decorator(obj):
# def _get_safe_decorator(decorator_name):
# 
# Path: tensorflow_model_remediation/common/types.py

# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/kernel_utils.py
# _STRING_TO_KERNEL_DICT = {}
# def _register_kernel_names(kernel_class, names):
# def _get_kernel(kernel: Union[base_kernel.MinDiffKernel, str],
#                 kernel_var_name: str = 'kernel'):


import abc
import re
import dill
import tensorflow as tf
from typing import Optional, Tuple
from tensorflow_model_remediation.common import docs
from tensorflow_model_remediation.common import types
from tensorflow_model_remediation.min_diff.losses.kernels import kernel_utils
    If `self.*_kernel` is `None`, then the corresponding input is returned
    unchanged.

    ```
    loss = ...  # MinDiffLoss subclass instance
    loss.membership_kernel = None
    loss.predictions_kernel = min_diff.losses.GaussKernel
    # Call with test inputs.
    loss._apply_kernels([1, 2, 3], [4, 5, 6])  # ([1, 2, 3], GaussKernel([4, 5, 6]))

    # With both kernels set to None, _apply_kernels is the identity.
    loss.predictions_kernel = None
    # Call with test inputs.
    loss._apply_kernels([1, 2, 3], [4, 5, 6])  # ([1, 2, 3], [4, 5, 6])
    ```

    This function is meant for internal use by subclasses when the instance is
    invoked.

    Returns:
      Tuple of (`membership_kernel_output`, `predictions_kernel_output`).
    """
    # pyformat: enable
    if self.membership_kernel is not None:
      membership = self.membership_kernel(membership)
    if self.predictions_kernel is not None:
      predictions = self.predictions_kernel(predictions)
    return membership, predictions

  @abc.abstractmethod

# Path: tensorflow_model_remediation/common/docs.py
# def _no_op_decorator(obj):
# def _get_safe_decorator(decorator_name):
# 
# Path: tensorflow_model_remediation/common/types.py

# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/kernel_utils.py
# _STRING_TO_KERNEL_DICT = {}
# def _register_kernel_names(kernel_class, names):
# def _get_kernel(kernel: Union[base_kernel.MinDiffKernel, str],
#                 kernel_var_name: str = 'kernel'):


# Path: tensorflow_model_remediation/min_diff/losses/base_loss.py
import abc
import re
import dill
import tensorflow as tf
from typing import Optional, Tuple
from tensorflow_model_remediation.common import docs
from tensorflow_model_remediation.common import types
from tensorflow_model_remediation.min_diff.losses.kernels import kernel_utils

    If `self.*_kernel` is `None`, then the corresponding input is returned
    unchanged.

    ```
    loss = ...  # MinDiffLoss subclass instance
    loss.membership_kernel = None
    loss.predictions_kernel = min_diff.losses.GaussKernel
    # Call with test inputs.
    loss._apply_kernels([1, 2, 3], [4, 5, 6])  # ([1, 2, 3], GaussKernel([4, 5, 6]))

    # With both kernels set to None, _apply_kernels is the identity.
    loss.predictions_kernel = None
    # Call with test inputs.
    loss._apply_kernels([1, 2, 3], [4, 5, 6])  # ([1, 2, 3], [4, 5, 6])
    ```

    This function is meant for internal use by subclasses when the instance is
    invoked.

    Returns:
      Tuple of (`membership_kernel_output`, `predictions_kernel_output`).
    """
    # pyformat: enable
    if self.membership_kernel is not None:
      membership = self.membership_kernel(membership)
    if self.predictions_kernel is not None:
      predictions = self.predictions_kernel(predictions)
    return membership, predictions

  @abc.abstractmethod

  @docs.do_not_doc_in_subclasses