tff.learning.metrics.create_default_secure_sum_quantization_ranges
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
Create a nested structure of quantization ranges for secure sum encoding.
tff.learning.metrics.create_default_secure_sum_quantization_ranges(
    local_unfinalized_metrics_type: tff.types.StructWithPythonType,
    lower_bound: Union[int, float] = DEFAULT_FIXED_SECURE_LOWER_BOUND,
    upper_bound: Union[int, float] = DEFAULT_FIXED_SECURE_UPPER_BOUND,
    use_auto_tuned_bounds_for_float_values: Optional[bool] = True
) -> MetricValueRangeDict
| Args | 
|---|
| local_unfinalized_metrics_type | The tff.Typestructure to generate default
secure sum quantization ranges form. Must be atff.Typetree containing
onlytff.TensorTypeandtff.StructType. Eachtff.TensorTypemust be
of floating point or integer dtype. | 
| lower_bound | An optional integer or floating point lower bound for the
secure sum quantization range. Values smaller than this will be clipped to
this value. By default is 0. If afloat, anytff.TensorTypeinlocal_unfinalized_metrics_typewith an integer dtype will usemath.ceil(lower_bound)as a bound. | 
| upper_bound | An optional integer or floating point upper bound for the
secure sum quantization range. Values larger than this will be clipped to
this value. By default is 2^20 - 1(~1 million). If afloat, anytff.TensorTypeinlocal_unfinalized_metrics_typewith an integer dtype
will usemath.floor(lower_bound)as a bound. | 
| use_auto_tuned_bounds_for_float_values | An optional boolean for specifying
whether to use auto-tuned bounds for float values. If True, a default tff.templates.EstimationProcessis used forupper_bound, and thelower_boundis None to allowtff.aggregators.SecureSumFactoryto
determine thelower_bound. | 
| Returns | 
|---|
| A nested structure matching the structure of local_unfinalized_metrics_typewhere eachtf.TensorTypehas been
replaced with a 2-tuple of lower bound and upper bound, where the tuple
can be (float,float) or (None,tff.templates.EstimationProcess) for
floating dtypes, and (int,int) for integer dtypes. | 
| Raises | 
|---|
| UnquantizableDTypeError | If A tff.TensorTypeinlocal_unfinalized_metrics_typehas a non-float or non-integer dtype. | 
| ValueError | If an integer dtype in local_unfinalized_metrics_typewill
have a zero range (e.g.math.ceil(lower_bound) - math.floor(upper_bound)
< 1). | 
  
  
 
  
    
    
      
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2024-09-20 UTC.
  
  
  
    
      [null,null,["Last updated 2024-09-20 UTC."],[],[]]