# Path: deep_verify/src/common.py
# def with_explicit_update(volatile_value):
#   def materialise(value):
# def targeted_objective(final_w, final_b, labels):
# def concave_max_binsearch(fn, lb, ub, num_iter=20):
# def _prod(lst):
# def convolution(x, kernel, padding, strides):
# def conv_transpose(y, kernel, result_shape, padding, strides):
# def avgpool_transpose(y, result_shape, kernel_shape, strides):
# def conv_broadcast(x, kernel_shape, padding, strides):
# def conv2d_broadcast(x, kernel_height, kernel_width, padding, strides):
# def conv1d_broadcast(x, kernel_length, padding, stride):
# def conv_reduce_sum(x, result_shape, padding, strides):
# def conv2d_reduce_sum(x, input_height, input_width, padding, strides):
# def conv1d_reduce_sum(x, input_length, padding, stride):


import abc
import collections
import six
import sonnet as snt
import tensorflow as tf
from deep_verify.src import common
from interval_bound_propagation import layer_utils
      Tensor of shape (num_targets, batch_size),
      containing  b^T y .
    """

  @abc.abstractmethod
  def flatten(self):
    """Flattens the affine transform, materialising it as fully connected.

    Returns:
      w_flat:
        2D tensor of shape (input_size, output_size).
      b_flat:
        1D tensor of shape (output_size).
    """


class Conv(AffineLayer):
  """Wraps a convolutional layer."""

  def __init__(self, input_node, output_node, module, batch_norm=None,
               reshape=False):
    super(Conv, self).__init__(input_node, output_node, module,
                               batch_norm=batch_norm, reshape=reshape)
    self._w = module.w
    self._b = module.b if module.has_bias else None
    self._padding = module.padding
    self._strides = module.stride[1:-1]

  def forward_prop(self, x, apply_bias=False, w_fn=None):
    w = w_fn(self._w) if w_fn is not None else self._w

# Path: deep_verify/src/common.py
# def with_explicit_update(volatile_value):
#   def materialise(value):
# def targeted_objective(final_w, final_b, labels):
# def concave_max_binsearch(fn, lb, ub, num_iter=20):
# def _prod(lst):
# def convolution(x, kernel, padding, strides):
# def conv_transpose(y, kernel, result_shape, padding, strides):
# def avgpool_transpose(y, result_shape, kernel_shape, strides):
# def conv_broadcast(x, kernel_shape, padding, strides):
# def conv2d_broadcast(x, kernel_height, kernel_width, padding, strides):
# def conv1d_broadcast(x, kernel_length, padding, stride):
# def conv_reduce_sum(x, result_shape, padding, strides):
# def conv2d_reduce_sum(x, input_height, input_width, padding, strides):
# def conv1d_reduce_sum(x, input_length, padding, stride):


# Path: deep_verify/src/layers/layers.py
import abc
import collections
import six
import sonnet as snt
import tensorflow as tf
from deep_verify.src import common
from interval_bound_propagation import layer_utils

      Tensor of shape (num_targets, batch_size),
      containing  b^T y .
    """

  @abc.abstractmethod
  def flatten(self):
    """Flattens the affine transform, materialising it as fully connected.

    Returns:
      w_flat:
        2D tensor of shape (input_size, output_size).
      b_flat:
        1D tensor of shape (output_size).
    """


class Conv(AffineLayer):
  """Wraps a convolutional layer."""

  def __init__(self, input_node, output_node, module, batch_norm=None,
               reshape=False):
    super(Conv, self).__init__(input_node, output_node, module,
                               batch_norm=batch_norm, reshape=reshape)
    self._w = module.w
    self._b = module.b if module.has_bias else None
    self._padding = module.padding
    self._strides = module.stride[1:-1]

  def forward_prop(self, x, apply_bias=False, w_fn=None):
    w = w_fn(self._w) if w_fn is not None else self._w

    y = common.convolution(x, tf.cast(w, x.dtype),