# Path: tensorflow_lattice/python/cdf_layer.py
# class CDF(tf.keras.layers.Layer):
#   def __init__(self,
#                num_keypoints,
#                units=1,
#                activation="relu6",
#                reduction="mean",
#                input_scaling_init=None,
#                input_scaling_type="fixed",
#                input_scaling_monotonicity="increasing",
#                sparsity_factor=1,
#                kernel_initializer="random_uniform",
#                **kwargs):
#   def build(self, input_shape):
#   def call(self, inputs):
#   def get_config(self):
# def create_kernel_initializer(kernel_initializer_id):
# 
# Path: tensorflow_lattice/python/test_utils.py
# class TimeTracker(object):
#   def __init__(self, list_to_append, num_steps=1):
#   def __enter__(self):
#   def __exit__(self, unuesd_type, unuesd_value, unuesd_traceback):
# def run_training_loop(config,
#                       training_data,
#                       keras_model,
#                       plot_path=None,
#                       input_dtype=np.float32,
#                       label_dtype=np.float32):
# def assert_sonnet_equivalent_to_keras(
#     test, sonnet_module_ctor, keras_layer_ctor,
#     training_inputs, training_labels,
#     epsilon=1e-4):
# def two_dim_mesh_grid(num_points, x_min, y_min, x_max, y_max):
# def sample_uniformly(num_points, lower_bounds, upper_bounds):
# def get_hypercube_interpolation_fn(coefficients):
#   def hypercube_interpolation_fn(x):
# def get_linear_lattice_interpolation_fn(lattice_sizes, monotonicities,
#                                         output_min, output_max):
#   def linear_interpolation_fn(x):


import math
import numpy as np
import tensorflow as tf
from absl import logging
from absl.testing import parameterized
from tensorflow_lattice.python import cdf_layer
from tensorflow_lattice.python import test_utils
      point = [np.random.random() for _ in range(input_dims)]
      x.append(np.asarray(point))
    if input_dims == 1:
      x.sort()
    return x

  def _ScatterXUniformlyExtendedRange(self, num_points, input_dims):
    """Extends every dimension by 1.0 on both sides and generates points."""
    np.random.seed(42)
    x = []
    for _ in range(num_points):
      point = [np.random.random() * 2 for _ in range(input_dims)]
      x.append(np.asarray(point))
    if input_dims == 1:
      x.sort()
    return x

  def _TwoDMeshGrid(self, num_points, input_dims):
    """Mesh grid for visualisation of 3-d surfaces via pyplot."""
    if input_dims != 2:
      raise ValueError("2-d mesh grid is possible only for 2-d inputs. Input"
                       " dimension given: %s" % input_dims)
    return test_utils.two_dim_mesh_grid(
        num_points=num_points, x_min=0.0, y_min=0.0, x_max=1.0, y_max=1.0)

  def _TwoDMeshGridExtendedRange(self, num_points, input_dims):
    """Mesh grid extended by 1.0 on every side."""
    if input_dims != 2:
      raise ValueError(
          "2-d mesh grid is possible only for 2-d lattice. Lattice")

# Path: tensorflow_lattice/python/cdf_layer.py
# class CDF(tf.keras.layers.Layer):
#   def __init__(self,
#                num_keypoints,
#                units=1,
#                activation="relu6",
#                reduction="mean",
#                input_scaling_init=None,
#                input_scaling_type="fixed",
#                input_scaling_monotonicity="increasing",
#                sparsity_factor=1,
#                kernel_initializer="random_uniform",
#                **kwargs):
#   def build(self, input_shape):
#   def call(self, inputs):
#   def get_config(self):
# def create_kernel_initializer(kernel_initializer_id):
# 
# Path: tensorflow_lattice/python/test_utils.py
# class TimeTracker(object):
#   def __init__(self, list_to_append, num_steps=1):
#   def __enter__(self):
#   def __exit__(self, unuesd_type, unuesd_value, unuesd_traceback):
# def run_training_loop(config,
#                       training_data,
#                       keras_model,
#                       plot_path=None,
#                       input_dtype=np.float32,
#                       label_dtype=np.float32):
# def assert_sonnet_equivalent_to_keras(
#     test, sonnet_module_ctor, keras_layer_ctor,
#     training_inputs, training_labels,
#     epsilon=1e-4):
# def two_dim_mesh_grid(num_points, x_min, y_min, x_max, y_max):
# def sample_uniformly(num_points, lower_bounds, upper_bounds):
# def get_hypercube_interpolation_fn(coefficients):
#   def hypercube_interpolation_fn(x):
# def get_linear_lattice_interpolation_fn(lattice_sizes, monotonicities,
#                                         output_min, output_max):
#   def linear_interpolation_fn(x):


# Path: tensorflow_lattice/python/cdf_test.py
import math
import numpy as np
import tensorflow as tf
from absl import logging
from absl.testing import parameterized
from tensorflow_lattice.python import cdf_layer
from tensorflow_lattice.python import test_utils

      point = [np.random.random() for _ in range(input_dims)]
      x.append(np.asarray(point))
    if input_dims == 1:
      x.sort()
    return x

  def _ScatterXUniformlyExtendedRange(self, num_points, input_dims):
    """Extends every dimension by 1.0 on both sides and generates points."""
    np.random.seed(42)
    x = []
    for _ in range(num_points):
      point = [np.random.random() * 2 for _ in range(input_dims)]
      x.append(np.asarray(point))
    if input_dims == 1:
      x.sort()
    return x

  def _TwoDMeshGrid(self, num_points, input_dims):
    """Mesh grid for visualisation of 3-d surfaces via pyplot."""
    if input_dims != 2:
      raise ValueError("2-d mesh grid is possible only for 2-d inputs. Input"
                       " dimension given: %s" % input_dims)
    return test_utils.two_dim_mesh_grid(
        num_points=num_points, x_min=0.0, y_min=0.0, x_max=1.0, y_max=1.0)

  def _TwoDMeshGridExtendedRange(self, num_points, input_dims):
    """Mesh grid extended by 1.0 on every side."""
    if input_dims != 2:
      raise ValueError(
          "2-d mesh grid is possible only for 2-d lattice. Lattice")

    return test_utils.two_dim_mesh_grid(