parameters: (input_graph=None,
                    is_training=True,
                    weight_bits=8,
                    activation_bits=8,
                    symmetric=False,
                    quant_delay=None,
                    freeze_bn_delay=None,
                    scope=None)
docstring: Rewrites an input_graph in place for simulated quantization.
  
    The graph has fake quantization ops inserted to simulate the error
    introduced by quantization. Since the graph is transformed in place,
    the expected behavior of previously held references to nodes and tensors may
    change.
  
    Args:
      input_graph: The tf.Graph to be transformed, if None then defaults to the
        default graph.
      is_training: Whether quantizing training or eval graph.
      weight_bits: Number of bits to use for quantizing weights.
      activation_bits: Number of bits to use for quantizing activations.
      symmetric: If true, use symmetric quantization limits instead of training
        the minimum and maximum of each quantization range separately.
      quant_delay: Number of steps after which weights and activations are
        quantized during training.
      freeze_bn_delay: Number of steps after which moving mean and variance are
        frozen and used instead of batch statistics during training.
        freeze_bn_delay should be greater than quant_delay and should correspond
        to the number of steps when training has almost converged
      scope: The scope to be transformed. If it's not None, only the ops which
        are in this scope will be transformed.
  
    Raises:
      ValueError: If elements contains an element that isn't a tf.Tensor or
        tf.Operation.
docstring_summary: Rewrites an input_graph in place for simulated quantization.
docstring_tokens: Rewrites an input_graph in place for simulated quantization .
function: def _create_graph(input_graph=None,
                    is_training=True,
                    weight_bits=8,
                    activation_bits=8,
                    symmetric=False,
                    quant_delay=None,
                    freeze_bn_delay=None,
                    scope=None):
    """Rewrites an input_graph in place for simulated quantization.
  
    The graph has fake quantization ops inserted to simulate the error
    introduced by quantization. Since the graph is transformed in place,
    the expected behavior of previously held references to nodes and tensors may
    change.
  
    Args:
      input_graph: The tf.Graph to be transformed, if None then defaults to the
        default graph.
      is_training: Whether quantizing training or eval graph.
      weight_bits: Number of bits to use for quantizing weights.
      activation_bits: Number of bits to use for quantizing activations.
      symmetric: If true, use symmetric quantization limits instead of training
        the minimum and maximum of each quantization range separately.
      quant_delay: Number of steps after which weights and activations are
        quantized during training.
      freeze_bn_delay: Number of steps after which moving mean and variance are
        frozen and used instead of batch statistics during training.
        freeze_bn_delay should be greater than quant_delay and should correspond
        to the number of steps when training has almost converged
      scope: The scope to be transformed. If it's not None, only the ops which
        are in this scope will be transformed.
  
    Raises:
      ValueError: If elements contains an element that isn't a tf.Tensor or
        tf.Operation.
    """
  
    if input_graph is None:
      input_graph = ops.get_default_graph()
  
    # Add check to see if graph has training ops, if so provide error message and
    # exit
    _check_for_training_ops(input_graph)
    with input_graph.as_default():
      fold_batch_norms.FoldBatchNorms(
          input_graph,
          freeze_batch_norm_delay=freeze_bn_delay,
          is_training=is_training)
      quantize.Quantize(
          input_graph,
          is_training,
          quant_delay=quant_delay,
          weight_bits=weight_bits,
          activation_bits=activation_bits,
          symmetric=symmetric,
          scope=scope)
function_tokens: def _create_graph ( input_graph = None , is_training = True , weight_bits = 8 , activation_bits = 8 , symmetric = False , quant_delay = None , freeze_bn_delay = None , scope = None ) : if input_graph is None : input_graph = ops . get_default_graph ( ) # Add check to see if graph has training ops, if so provide error message and # exit _check_for_training_ops ( input_graph ) with input_graph . as_default ( ) : fold_batch_norms . FoldBatchNorms ( input_graph , freeze_batch_norm_delay = freeze_bn_delay , is_training = is_training ) quantize . Quantize ( input_graph , is_training , quant_delay = quant_delay , weight_bits = weight_bits , activation_bits = activation_bits , symmetric = symmetric , scope = scope )