class_docstr: This module implements the task- and model-specific estimator for PyTorch GOTURN (object tracking).
class_docstr_tok: ["This","module","implements","the","task-","and","model-specific","estimator","for","PyTorch","GOTURN","(","object","tracking",")","."]
docstr: Track object across frames.
  
  :param x: A single video of shape (nb_frames, nb_height, nb_width, nb_channels)
  :param y_init: Initial bounding box around object on the first frame of `x`.
  :return: Predicted bounding box coordinates for all frames of shape (nb_frames, 4) in format [x1, y1, x2, y2].
docstr_tok: ["Track","object","across","frames",".",":","param","x",":","A","single","video","of","shape","(","nb_frames",",","nb_height",",","nb_width",",","nb_channels",")",":","param","y_init",":","Initial","bounding","box","around","object","on","the","first","frame","of","`","x","`",".",":","return",":","Predicted","bounding","box","coordinates","for","all","frames","of","shape","(","nb_frames",",","4",")","in","format","[","x1",",","y1",",","x2",",","y2","]","."]
code: def _track(
      self, x: "torch.Tensor", y_init: "torch.Tensor"
  ) -> "torch.Tensor":
      """
      Track object across frames.
  
      :param x: A single video of shape (nb_frames, nb_height, nb_width, nb_channels)
      :param y_init: Initial bounding box around object on the first frame of `x`.
      :return: Predicted bounding box coordinates for all frames of shape (nb_frames, 4) in format [x1, y1, x2, y2].
      """
      import torch
  
      num_frames = x.shape[0]
      prev = x[0]
      bbox_0 = y_init
      y_pred_list = [y_init]
  
      for i in range(1, num_frames):
          curr = x[i]
          bbox_0 = self._track_step(curr, prev, bbox_0)
          bbox = bbox_0
          prev = curr
  
          y_pred_list.append(bbox)
  
      y_pred = torch.stack(y_pred_list)
  
      return y_pred
  
imports: import logging
  import time
  from typing import List, Dict, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  from art.estimators.object_tracking.object_tracker import ObjectTrackerMixin
  from art.estimators.pytorch import PyTorchEstimator
label_desc: Use image node_id 9 for calling the PyTorchGoturn obj's underlying member method code with example usage: obj._track(x, y_init) and returns: y_pred