code: def range_to_anchors_and_delta(precision_range, num_anchors):
      """Calculates anchor points from precision range.
  
      Args:
          precision_range: an interval (a, b), where 0.0 <= a <= b <= 1.0
          num_anchors: int, number of equally spaced anchor points.
  
      Returns:
          precision_values: A `Tensor` of [num_anchors] equally spaced values
              in the interval precision_range.
  
          delta: The spacing between the values in precision_values.
  
      Raises:
          ValueError: If precision_range is invalid.
      """
      # Validate precision_range.
      if len(precision_range) != 2:
          raise ValueError(
              "length of precision_range (%d) must be 2"
              % len(precision_range)
          )
      if not 0 <= precision_range[0] <= precision_range[1] <= 1:
          raise ValueError(
              "precision values must follow 0 <= %f <= %f <= 1"
              % (precision_range[0], precision_range[1])
          )
  
      # Sets precision_values uniformly between min_precision and max_precision.
      precision_values = numpy.linspace(
          start=precision_range[0],
          stop=precision_range[1],
          num=num_anchors + 1,
      )[1:]
  
      delta = (precision_range[1] - precision_range[0]) / num_anchors
      return FloatTensor(precision_values), delta
  
file_path: pytext/pytext/utils/loss.py
imports: import numpy
  import torch
  from .cuda import FloatTensor
label_desc: Use image node_id 1 for calling a global function with example usage: range_to_anchors_and_delta(precision_range, num_anchors) and returns: FloatTensor,  delta