original_docstring: 
      Description
      -----------
      Calculates intersection over union for all sets of boxes in a and b
  
      Parameters
      ----------
      a : a torch of size [batch_size,4] of bounding boxes in xyxy formulation
      b : a torch of size [batch_size,4] of bounding boxes in xyxy formulation
  
      Returns
      -------
      mean_iou - float between [0,1] with average iou for a and b
      
docstring: Description
  Calculates intersection over union for all sets of boxes in a and b
  
  Parameters
  
  a : a torch of size [batch_size,4] of bounding boxes in xyxy formulation
  b : a torch of size [batch_size,4] of bounding boxes in xyxy formulation
  
  Returns
  
  float between [0,1] with average iou for a and b
docstring_tokens: Description Calculates intersection over union for all sets of boxes in a and b Parameters a : a torch of size [ batch_size 4 ] of bounding boxes in xyxy formulation b : a torch of size [ batch_size 4 ] of bounding boxes in xyxy formulation Returns float between [ 0 1 ] with average iou for a and b
code: def iou(a,b):
      """
      Description
      -----------
      Calculates intersection over union for all sets of boxes in a and b
  
      Parameters
      ----------
      a : a torch of size [batch_size,4] of bounding boxes in xyxy formulation
      b : a torch of size [batch_size,4] of bounding boxes in xyxy formulation
  
      Returns
      -------
      mean_iou - float between [0,1] with average iou for a and b
      """
      a = a.unsqueeze(0)
      b = b.unsqueeze(0)
      area_a = (a[:,2]-a[:,0]) * (a[:,3] - a[:,1])
      area_b = (b[:,2]-b[:,0]) * (b[:,3] - b[:,1])
      
      minx = torch.max(a[:,0], b[:,0])
      maxx = torch.min(a[:,2], b[:,2])
      miny = torch.max(a[:,1], b[:,1])
      maxy = torch.min(a[:,3], b[:,3])
      zeros = torch.zeros(minx.shape,dtype=float)
      
      intersection = torch.max(zeros, maxx-minx) * torch.max(zeros,maxy-miny)
      union = area_a + area_b - intersection
      iou = torch.div(intersection,union)
      mean_iou = torch.mean(iou)
      
      return mean_iou
code_tokens: def iou ( a , b ) : a = a . unsqueeze ( 0 ) b = b . unsqueeze ( 0 ) area_a = ( a [ : , 2 ] - a [ : , 0 ] ) * ( a [ : , 3 ] - a [ : , 1 ] ) area_b = ( b [ : , 2 ] - b [ : , 0 ] ) * ( b [ : , 3 ] - b [ : , 1 ] ) minx = torch . max ( a [ : , 0 ] , b [ : , 0 ] ) maxx = torch . min ( a [ : , 2 ] , b [ : , 2 ] ) miny = torch . max ( a [ : , 1 ] , b [ : , 1 ] ) maxy = torch . min ( a [ : , 3 ] , b [ : , 3 ] ) zeros = torch . zeros ( minx . shape , dtype = float ) intersection = torch . max ( zeros , maxx - minx ) * torch . max ( zeros , maxy - miny ) union = area_a + area_b - intersection iou = torch . div ( intersection , union ) mean_iou = torch . mean ( iou ) return mean_iou
short_docstring: Description
  Calculates intersection over union for all sets of boxes in a and b
short_docstring_tokens: Description Calculates intersection over union for all sets of boxes in a and b
comment: """
      Description
      -----------
      Calculates intersection over union for all sets of boxes in a and b
  
      Parameters
      ----------
      a : a torch of size [batch_size,4] of bounding boxes in xyxy formulation
      b : a torch of size [batch_size,4] of bounding boxes in xyxy formulation
  
      Returns
      -------
      mean_iou - float between [0,1] with average iou for a and b
      """