class_docstr: A classification head for use in RetinaNet.
  
  Args:
      in_channels (int): number of channels of the input feature
      num_anchors (int): number of anchors to be predicted
      num_classes (int): number of classes to be predicted
class_docstr_tok: ["A","classification","head","for","use","in","RetinaNet",".","Args",":","in_channels","(","int",")",":","number","of","channels","of","the","input","feature","num_anchors","(","int",")",":","number","of","anchors","to","be","predicted","num_classes","(","int",")",":","number","of","classes","to","be","predicted"]
code: def forward(self, x: Tensor) -> Tensor:
      all_cls_logits = []
  
      # 遍历每个预测特征层
      for features in x:
          cls_logits = self.conv(features)
          cls_logits = self.cls_logits(cls_logits)
  
          # Permute classification output from (N, A * K, H, W) to (N, HWA, K).
          N, _, H, W = cls_logits.shape
          cls_logits = cls_logits.view(N, -1, self.num_classes, H, W)
          # [N, A, K, H, W] -> [N, H, W, A, K]
          cls_logits = cls_logits.permute(0, 3, 4, 1, 2)
          # [N, H, W, A, K] -> [N, HWA, K]
          cls_logits = cls_logits.reshape(N, -1, self.num_classes)
  
          all_cls_logits.append(cls_logits)
  
      return torch.cat(all_cls_logits, dim=1)
  
imports: import math
  import warnings
  from collections import OrderedDict
  from typing import Dict, List, Tuple, Optional, Union
  import torch
  from torch import nn, Tensor
  from .None import det_utils
  from .anchor_utils import AnchorsGenerator
  from .None import boxes
  from .losses import sigmoid_focal_loss
  from .transform import GeneralizedRCNNTransform
label_desc: Use image node_id 3 for calling the RetinaNetClassificationHead obj's underlying member method code with example usage: obj.forward(x) and returns: torch