# Path: deep_verify/src/layers/layers.py
# class VerifiableLayer(object):
# class CustomOp(object):
# class SingleVerifiableLayer(VerifiableLayer):
# class AffineLayer(SingleVerifiableLayer):
# class Conv(AffineLayer):
# class Linear(AffineLayer):
# class AvgPool(AffineLayer):
# class MaxPool(SingleVerifiableLayer):
# class Activation(SingleVerifiableLayer):
#   def __init__(self):
#   def branches(self):
#   def input_node(self):
#   def output_node(self):
#   def input_shape(self):
#   def output_shape(self):
#   def inputs(self):
#   def outputs(self):
#   def input_bounds(self):
#   def output_bounds(self):
#   def dual_shape(self):
#   def set_no_duals(self):
#   def reshape_duals_forwards(self, next_layer, dual_vars):
#   def project_duals_op(self, dual_vars):  # pylint:disable=unused-argument
#   def visit_linear(self, layer, w, b, *args, **kwargs):
#   def visit_conv(self, layer, w, b, padding, strides, *args, **kwargs):
#   def visit_avgpool(self, layer, *args, **kwargs):
#   def visit_maxpool(self, layer, *args, **kwargs):
#   def visit_activation(self, layer, *args, **kwargs):
#   def __init__(self, input_node, output_node, module,
#                batch_norm=None, reshape=False):
#   def input_node(self):
#   def output_node(self):
#   def is_activation(self):
#   def module(self):
#   def batch_norm(self):
#   def reshape(self):
#   def backward_prop_batchnorm(self, y):
#   def backward_prop_batchnorm_bias(self, y, bias):
#   def custom_op(self, op, *args, **kwargs):
#   def is_activation(self):
#   def forward_prop(self, x, apply_bias=False, w_fn=None):
#   def backward_prop(self, y, w_fn=None):
#   def backward_prop_bias(self, y):
#   def flatten(self):
#   def __init__(self, input_node, output_node, module, batch_norm=None,
#                reshape=False):
#   def forward_prop(self, x, apply_bias=False, w_fn=None):
#   def backward_prop(self, y, w_fn=None):
#   def backward_prop_bias(self, y):
#   def flatten(self):
#   def custom_op(self, op, *args, **kwargs):
#   def __init__(self, input_node, output_node, module, batch_norm=None,
#                reshape=False):
#   def forward_prop(self, x, apply_bias=False, w_fn=None):
#   def backward_prop(self, y, w_fn=None):
#   def backward_prop_bias(self, y):
#   def flatten(self):
#   def custom_op(self, op, *args, **kwargs):
#   def get_objective_weights(self, labels, target_strategy=None):
#   def __init__(self, input_node, output_node,
#                kernel_shape, strides, reshape=False):
#   def kernel_shape(self):
#   def strides(self):
#   def forward_prop(self, x, apply_bias=False, w_fn=None):
#   def backward_prop(self, y, w_fn=None):
#   def backward_prop_bias(self, y):
#   def flatten(self):
#   def custom_op(self, op, *args, **kwargs):
#   def __init__(self, input_node, output_node,
#                kernel_shape, strides, with_relu=False, reshape=False):
#   def kernel_shape(self):
#   def strides(self):
#   def with_relu(self):
#   def is_activation(self):
#   def custom_op(self, op, *args, **kwargs):
#   def __init__(self, input_node, output_node, module,
#                reshape=False, parameters=None):
#   def is_activation(self):
#   def activation(self):
#   def parameters(self):
#   def custom_op(self, op, *args, **kwargs):
# def create_verifiable_layer(input_node, output_node, module,
#                             batch_norm=None, reshape=False,
#                             parameters=None):


from deep_verify.src.layers import layers
import interval_bound_propagation as ibp
import sonnet as snt
          strides=None,
          reshape=reshape))
      return input_tensor, known_fanout, verifiable_layers, False

    elif isinstance(node.module, snt.BatchNorm):
      # Construct the previous layer with batchnorm.
      if batchnorm_node:
        raise NotVerifiableError('Cannot have consecutive batchnorms')
      input_node, = self._network.dependencies(node)
      return self._build_layers_rec(input_node, batchnorm_node=node)

    elif isinstance(node.module, snt.BatchReshape):
      # Recursively build all preceding layers.
      input_node, = self._network.dependencies(node)
      backstop_node, known_fanout, verifiable_layers, reshape = (
          self._build_layers_rec(input_node))
      if batchnorm_node:
        raise NotVerifiableError('Reshape cannot have batchnorm')
      return backstop_node, known_fanout, verifiable_layers, True

    else:
      # Recursively build all preceding layers.
      input_nodes = self._network.dependencies(node)
      if len(input_nodes) != 1:
        raise NotVerifiableError('Unary operation expected')
      input_node, = input_nodes
      backstop_node, known_fanout, verifiable_layers, reshape = (
          self._build_layers_rec(input_node))

      # Construct the layer.

# Path: deep_verify/src/layers/layers.py
# class VerifiableLayer(object):
# class CustomOp(object):
# class SingleVerifiableLayer(VerifiableLayer):
# class AffineLayer(SingleVerifiableLayer):
# class Conv(AffineLayer):
# class Linear(AffineLayer):
# class AvgPool(AffineLayer):
# class MaxPool(SingleVerifiableLayer):
# class Activation(SingleVerifiableLayer):
#   def __init__(self):
#   def branches(self):
#   def input_node(self):
#   def output_node(self):
#   def input_shape(self):
#   def output_shape(self):
#   def inputs(self):
#   def outputs(self):
#   def input_bounds(self):
#   def output_bounds(self):
#   def dual_shape(self):
#   def set_no_duals(self):
#   def reshape_duals_forwards(self, next_layer, dual_vars):
#   def project_duals_op(self, dual_vars):  # pylint:disable=unused-argument
#   def visit_linear(self, layer, w, b, *args, **kwargs):
#   def visit_conv(self, layer, w, b, padding, strides, *args, **kwargs):
#   def visit_avgpool(self, layer, *args, **kwargs):
#   def visit_maxpool(self, layer, *args, **kwargs):
#   def visit_activation(self, layer, *args, **kwargs):
#   def __init__(self, input_node, output_node, module,
#                batch_norm=None, reshape=False):
#   def input_node(self):
#   def output_node(self):
#   def is_activation(self):
#   def module(self):
#   def batch_norm(self):
#   def reshape(self):
#   def backward_prop_batchnorm(self, y):
#   def backward_prop_batchnorm_bias(self, y, bias):
#   def custom_op(self, op, *args, **kwargs):
#   def is_activation(self):
#   def forward_prop(self, x, apply_bias=False, w_fn=None):
#   def backward_prop(self, y, w_fn=None):
#   def backward_prop_bias(self, y):
#   def flatten(self):
#   def __init__(self, input_node, output_node, module, batch_norm=None,
#                reshape=False):
#   def forward_prop(self, x, apply_bias=False, w_fn=None):
#   def backward_prop(self, y, w_fn=None):
#   def backward_prop_bias(self, y):
#   def flatten(self):
#   def custom_op(self, op, *args, **kwargs):
#   def __init__(self, input_node, output_node, module, batch_norm=None,
#                reshape=False):
#   def forward_prop(self, x, apply_bias=False, w_fn=None):
#   def backward_prop(self, y, w_fn=None):
#   def backward_prop_bias(self, y):
#   def flatten(self):
#   def custom_op(self, op, *args, **kwargs):
#   def get_objective_weights(self, labels, target_strategy=None):
#   def __init__(self, input_node, output_node,
#                kernel_shape, strides, reshape=False):
#   def kernel_shape(self):
#   def strides(self):
#   def forward_prop(self, x, apply_bias=False, w_fn=None):
#   def backward_prop(self, y, w_fn=None):
#   def backward_prop_bias(self, y):
#   def flatten(self):
#   def custom_op(self, op, *args, **kwargs):
#   def __init__(self, input_node, output_node,
#                kernel_shape, strides, with_relu=False, reshape=False):
#   def kernel_shape(self):
#   def strides(self):
#   def with_relu(self):
#   def is_activation(self):
#   def custom_op(self, op, *args, **kwargs):
#   def __init__(self, input_node, output_node, module,
#                reshape=False, parameters=None):
#   def is_activation(self):
#   def activation(self):
#   def parameters(self):
#   def custom_op(self, op, *args, **kwargs):
# def create_verifiable_layer(input_node, output_node, module,
#                             batch_norm=None, reshape=False,
#                             parameters=None):


# Path: deep_verify/src/auto_verifier.py
from deep_verify.src.layers import layers
import interval_bound_propagation as ibp
import sonnet as snt

          strides=None,
          reshape=reshape))
      return input_tensor, known_fanout, verifiable_layers, False

    elif isinstance(node.module, snt.BatchNorm):
      # Construct the previous layer with batchnorm.
      if batchnorm_node:
        raise NotVerifiableError('Cannot have consecutive batchnorms')
      input_node, = self._network.dependencies(node)
      return self._build_layers_rec(input_node, batchnorm_node=node)

    elif isinstance(node.module, snt.BatchReshape):
      # Recursively build all preceding layers.
      input_node, = self._network.dependencies(node)
      backstop_node, known_fanout, verifiable_layers, reshape = (
          self._build_layers_rec(input_node))
      if batchnorm_node:
        raise NotVerifiableError('Reshape cannot have batchnorm')
      return backstop_node, known_fanout, verifiable_layers, True

    else:
      # Recursively build all preceding layers.
      input_nodes = self._network.dependencies(node)
      if len(input_nodes) != 1:
        raise NotVerifiableError('Unary operation expected')
      input_node, = input_nodes
      backstop_node, known_fanout, verifiable_layers, reshape = (
          self._build_layers_rec(input_node))

      # Construct the layer.

      verifiable_layers.append(layers.create_verifiable_layer(