code: def forward(self, hidden_states: Tensor, labels: Tensor):
      # copy-pasted from
      # https://github.com/ronghanghu/vqa-maskrcnn-benchmark-m4c/blob/0fbccee2dfed10d652bcf014f9f8bfafd8478f51/maskrcnn_benchmark/modeling/roi_heads/box_head/roi_box_predictors.py#L76-L96  # NoQA
  
      # get embeddings of indices using gt cls labels
      cls_embed_out = self.cls_embed(labels)
  
      # concat with fc7 feats
      concat_attr = torch.cat([hidden_states, cls_embed_out], dim=-1)
  
      # pass through attr head layers
      fc_attr = self.attr_linear1(concat_attr)
      attr_score = F.relu(self.attr_linear2(fc_attr))
  
      return attr_score
  
imports: from typing import Optional
  import torch
  import torch.nn.functional
  from mmf.models.unit.backbone import build_unit_convnet_backbone
  from mmf.models.unit.matcher import HungarianMatcher
  from mmf.models.unit.misc import NestedTensor
  from mmf.models.unit.transformer import UniTTransformer
  from mmf.utils import box_ops
  from mmf.utils.distributed import get_world_size, is_dist_initialized
  from torch import nn, Tensor
label_desc: Use image node_id 2 for calling the AttributeHead obj's underlying member method code with example usage: obj.forward(hidden_states, labels) and returns: attr_score