parameters: (inputs, min_var, max_var, per_channel, num_bits,
                               narrow_range)
docstring: Adds a fake quantization operation.
  
    Depending on value of per_channel, this operation may do global quantization
    or per channel quantization.  min_var and max_var should have corresponding
    shapes: [1] when per_channel == False and [d] when per_channel == True.
  
    Args:
      inputs: a tensor containing values to be quantized.
      min_var: a variable containing quantization range lower end(s).
      max_var: a variable containing quantization range upper end(s).
      per_channel: a boolean specifying whether to use per-channel quantization.
      num_bits: Number of bits to use for quantization, must be between 2 and 8.
      narrow_range: Whether to use the narrow quantization range
        [1; 2^num_bits - 1] or wide range [0; 2^num_bits - 1].
    Returns:
      a tensor containing quantized values.
docstring_summary: Adds a fake quantization operation.
docstring_tokens: Adds a fake quantization operation .
function: def _FakeQuantWithMinMaxVars(inputs, min_var, max_var, per_channel, num_bits,
                               narrow_range):
    """Adds a fake quantization operation.
  
    Depending on value of per_channel, this operation may do global quantization
    or per channel quantization.  min_var and max_var should have corresponding
    shapes: [1] when per_channel == False and [d] when per_channel == True.
  
    Args:
      inputs: a tensor containing values to be quantized.
      min_var: a variable containing quantization range lower end(s).
      max_var: a variable containing quantization range upper end(s).
      per_channel: a boolean specifying whether to use per-channel quantization.
      num_bits: Number of bits to use for quantization, must be between 2 and 8.
      narrow_range: Whether to use the narrow quantization range
        [1; 2^num_bits - 1] or wide range [0; 2^num_bits - 1].
    Returns:
      a tensor containing quantized values.
    """
  
    if per_channel:
      assert len(min_var.get_shape()) == 1
      assert len(max_var.get_shape()) == 1
      return tf.quantization.fake_quant_with_min_max_vars_per_channel(
          inputs, min_var, max_var, num_bits=num_bits, narrow_range=narrow_range)
    else:
      assert min_var.get_shape() == []  # pylint: disable=g-explicit-bool-comparison
      assert max_var.get_shape() == []  # pylint: disable=g-explicit-bool-comparison
      return tf.quantization.fake_quant_with_min_max_vars(
          inputs, min_var, max_var, num_bits=num_bits, narrow_range=narrow_range)
function_tokens: def _FakeQuantWithMinMaxVars ( inputs , min_var , max_var , per_channel , num_bits , narrow_range ) : if per_channel : assert len ( min_var . get_shape ( ) ) == 1 assert len ( max_var . get_shape ( ) ) == 1 return tf . quantization . fake_quant_with_min_max_vars_per_channel ( inputs , min_var , max_var , num_bits = num_bits , narrow_range = narrow_range ) else : assert min_var . get_shape ( ) == [ ] # pylint: disable=g-explicit-bool-comparison assert max_var . get_shape ( ) == [ ] # pylint: disable=g-explicit-bool-comparison return tf . quantization . fake_quant_with_min_max_vars ( inputs , min_var , max_var , num_bits = num_bits , narrow_range = narrow_range )