code: def encode(bboxes, gt_boxes, variances=None):
      with tf.name_scope("BoundingBoxTransform/encode"):
          (
              bboxes_width,
              bboxes_height,
              bboxes_urx,
              bboxes_ury,
          ) = get_width_upright(bboxes)
  
          (
              gt_boxes_width,
              gt_boxes_height,
              gt_boxes_urx,
              gt_boxes_ury,
          ) = get_width_upright(gt_boxes)
  
          if variances is None:
              variances = [1.0, 1.0]
  
          targets_dx = (gt_boxes_urx - bboxes_urx) / (
              bboxes_width * variances[0]
          )
          targets_dy = (gt_boxes_ury - bboxes_ury) / (
              bboxes_height * variances[0]
          )
  
          targets_dw = (
              tf.log(gt_boxes_width / bboxes_width) / variances[1]
          )
          targets_dh = (
              tf.log(gt_boxes_height / bboxes_height) / variances[1]
          )
  
          targets = tf.concat(
              [targets_dx, targets_dy, targets_dw, targets_dh], axis=1
          )
  
          return targets
  
imports: import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: encode(bboxes, gt_boxes, variances) and returns: targets