# Path: tensorflow_model_remediation/min_diff/losses/kernels/base_kernel.py
# class MinDiffKernel(abc.ABC):
#   def __init__(self, tile_input: bool = True):
#   def __call__(self,
#                x: types.TensorType,
#                y: Optional[types.TensorType] = None) -> types.TensorType:
#   def call(self, x: types.TensorType, y: types.TensorType):
#   def get_config(self):
#   def from_config(cls, config):
# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/gaussian_kernel.py
# class GaussianKernel(base_kernel.MinDiffKernel):
#   def __init__(self, kernel_length: complex = 0.1, **kwargs):
#   def call(self, x: types.TensorType, y: types.TensorType) -> types.TensorType:
#   def get_config(self):
# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/laplacian_kernel.py
# _EPSILON = 1.0e-8
# class LaplacianKernel(base_kernel.MinDiffKernel):
#   def __init__(self, kernel_length: complex = 0.1, **kwargs):
#   def call(self, x: types.TensorType, y: types.TensorType) -> types.TensorType:
#   def get_config(self):


from typing import Union
from tensorflow_model_remediation.min_diff.losses.kernels import base_kernel
from tensorflow_model_remediation.min_diff.losses.kernels import gaussian_kernel
from tensorflow_model_remediation.min_diff.losses.kernels import laplacian_kernel
  for name in names:
    _STRING_TO_KERNEL_DICT[name] = kernel_class
    if not name.endswith('_kernel'):
      _STRING_TO_KERNEL_DICT[name + '_kernel'] = kernel_class


_register_kernel_names(gaussian_kernel.GaussianKernel, ['gauss', 'gaussian'])
_register_kernel_names(laplacian_kernel.LaplacianKernel,
                       ['laplace', 'laplacian'])


def _get_kernel(kernel: Union[base_kernel.MinDiffKernel, str],
                kernel_var_name: str = 'kernel'):
  """Returns a `losses.MinDiffKernel` instance corresponding to `kernel`.

  If `kernel` is an instance of `losses.MinDiffKernel` then it is returned
  directly. If `kernel` is a string it must be an accepted kernel name. A
  value of `None` is also accepted and simply returns `None`.

  Args:
    kernel: kernel instance. Can be `None`, a string or an instance of
      `losses.MinDiffKernel`.
    kernel_var_name: Name of the kernel variable. This is only used for error
      messaging.

  Returns:
    Returns a MinDiffKernel instance.
  """
  if kernel is None:
    return None

# Path: tensorflow_model_remediation/min_diff/losses/kernels/base_kernel.py
# class MinDiffKernel(abc.ABC):
#   def __init__(self, tile_input: bool = True):
#   def __call__(self,
#                x: types.TensorType,
#                y: Optional[types.TensorType] = None) -> types.TensorType:
#   def call(self, x: types.TensorType, y: types.TensorType):
#   def get_config(self):
#   def from_config(cls, config):
# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/gaussian_kernel.py
# class GaussianKernel(base_kernel.MinDiffKernel):
#   def __init__(self, kernel_length: complex = 0.1, **kwargs):
#   def call(self, x: types.TensorType, y: types.TensorType) -> types.TensorType:
#   def get_config(self):
# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/laplacian_kernel.py
# _EPSILON = 1.0e-8
# class LaplacianKernel(base_kernel.MinDiffKernel):
#   def __init__(self, kernel_length: complex = 0.1, **kwargs):
#   def call(self, x: types.TensorType, y: types.TensorType) -> types.TensorType:
#   def get_config(self):


# Path: tensorflow_model_remediation/min_diff/losses/kernels/kernel_utils.py
from typing import Union
from tensorflow_model_remediation.min_diff.losses.kernels import base_kernel
from tensorflow_model_remediation.min_diff.losses.kernels import gaussian_kernel
from tensorflow_model_remediation.min_diff.losses.kernels import laplacian_kernel

  for name in names:
    _STRING_TO_KERNEL_DICT[name] = kernel_class
    if not name.endswith('_kernel'):
      _STRING_TO_KERNEL_DICT[name + '_kernel'] = kernel_class


_register_kernel_names(gaussian_kernel.GaussianKernel, ['gauss', 'gaussian'])
_register_kernel_names(laplacian_kernel.LaplacianKernel,
                       ['laplace', 'laplacian'])


def _get_kernel(kernel: Union[base_kernel.MinDiffKernel, str],
                kernel_var_name: str = 'kernel'):
  """Returns a `losses.MinDiffKernel` instance corresponding to `kernel`.

  If `kernel` is an instance of `losses.MinDiffKernel` then it is returned
  directly. If `kernel` is a string it must be an accepted kernel name. A
  value of `None` is also accepted and simply returns `None`.

  Args:
    kernel: kernel instance. Can be `None`, a string or an instance of
      `losses.MinDiffKernel`.
    kernel_var_name: Name of the kernel variable. This is only used for error
      messaging.

  Returns:
    Returns a MinDiffKernel instance.
  """
  if kernel is None:
    return None

  if isinstance(kernel, base_kernel.MinDiffKernel):