def prediction_tensors_to_temporal_offsets(y_indices, x_indices, offset_predictions):
    "Converts CenterNet temporal offset map predictions to batched format.\n\n  This function is similiar to the box offset conversion function, as both\n  temporal offsets and box offsets are size-2 vectors.\n\n  Args:\n    y_indices: A [batch, num_boxes] int32 tensor with y indices corresponding to\n      object center locations (expressed in output coordinate frame).\n    x_indices: A [batch, num_boxes] int32 tensor with x indices corresponding to\n      object center locations (expressed in output coordinate frame).\n    offset_predictions: A float tensor of shape [batch_size, height, width, 2]\n      representing the y and x offsets of a box's center across adjacent frames.\n\n  Returns:\n    offsets: A tensor of shape [batch_size, num_boxes, 2] holding the\n      the object temporal offsets of (y, x) dimensions.\n\n  "
    (_, _, width, _) = _get_shape(offset_predictions, 4)
    peak_spatial_indices = flattened_indices_from_row_col_indices(y_indices, x_indices, width)
    y_indices = _to_float32(y_indices)
    x_indices = _to_float32(x_indices)
    offsets_flat = _flatten_spatial_dimensions(offset_predictions)
    offsets = tf.gather(offsets_flat, peak_spatial_indices, batch_dims=1)
    return offsets
Converts CenterNet temporal offset map predictions to batched format.

This function is similiar to the box offset conversion function, as both
temporal offsets and box offsets are size-2 vectors.

Args:
  y_indices: A [batch, num_boxes] int32 tensor with y indices corresponding to
    object center locations (expressed in output coordinate frame).
  x_indices: A [batch, num_boxes] int32 tensor with x indices corresponding to
    object center locations (expressed in output coordinate frame).
  offset_predictions: A float tensor of shape [batch_size, height, width, 2]
    representing the y and x offsets of a box's center across adjacent frames.

Returns:
  offsets: A tensor of shape [batch_size, num_boxes, 2] holding the
    the object temporal offsets of (y, x) dimensions.
def prediction_tensors_to_temporal_offsets(y_indices, x_indices, offset_predictions):
    "Converts CenterNet temporal offset map predictions to batched format.\n\n  This function is similiar to the box offset conversion function, as both\n  temporal offsets and box offsets are size-2 vectors.\n\n  Args:\n    y_indices: A [batch, num_boxes] int32 tensor with y indices corresponding to\n      object center locations (expressed in output coordinate frame).\n    x_indices: A [batch, num_boxes] int32 tensor with x indices corresponding to\n      object center locations (expressed in output coordinate frame).\n    offset_predictions: A float tensor of shape [batch_size, height, width, 2]\n      representing the y and x offsets of a box's center across adjacent frames.\n\n  Returns:\n    offsets: A tensor of shape [batch_size, num_boxes, 2] holding the\n      the object temporal offsets of (y, x) dimensions.\n\n  "
    (_, _, width, _) = _get_shape(offset_predictions, 4)
    peak_spatial_indices = flattened_indices_from_row_col_indices(y_indices, x_indices, width)
    y_indices = _to_float32(y_indices)
    x_indices = _to_float32(x_indices)
    offsets_flat = _flatten_spatial_dimensions(offset_predictions)
    offsets = tf.gather(offsets_flat, peak_spatial_indices, batch_dims=1)
    return offsets