class_docstr: Optical Flow extractor.
  
  Computes the pixel displacement between 2 consecutive frames from a video clip.
docstr: Forward pass through the flow extractor.
  
  Args:
      first_frame (Tensor): Batch of starting frames of shape (N, 3, H, W).
      last_frame (Tensor): Batch of last frames of shape (N, 3, H, W).
  Returns:
      Tensor: Estimated optical flow map of shape (N, 2, H, W).
code: def forward(self, first_frame: Tensor, last_frame: Tensor) -> Tensor:
      """Forward pass through the flow extractor.
  
      Args:
          first_frame (Tensor): Batch of starting frames of shape (N, 3, H, W).
          last_frame (Tensor): Batch of last frames of shape (N, 3, H, W).
      Returns:
          Tensor: Estimated optical flow map of shape (N, 2, H, W).
      """
      height, width = first_frame.shape[-2:]
  
      # preprocess batch
      first_frame, last_frame = self.pre_process(
          first_frame, last_frame
      )
  
      # get flow maps
      with torch.no_grad():
          flows = self.model(first_frame, last_frame)[-1]
  
      # convert back to original size
      flows = F.resize(flows, [height, width], antialias=False)
  
      return flows
  
file_path: anomalib/src/anomalib/models/ai_vad/flow.py
imports: from __future__ import annotations
  import torch
  import torchvision.transforms.functional
  from torch import Tensor, nn
  from torchvision.models.optical_flow import Raft_Large_Weights, raft_large
label_desc: Use image node_id 3 for calling the FlowExtractor obj's underlying member method code with example usage: obj.forward(first_frame, last_frame) and returns: flows