code: def __init__(self, hidden_size, query_key_size=None):
      super().__init__()
  
      if query_key_size is None:
          query_key_size = hidden_size
      self.hidden_size = hidden_size
      self.query_key_size = query_key_size
  
      self.query = nn.Linear(hidden_size, query_key_size)
      self.key = nn.Linear(hidden_size, query_key_size)
  
imports: import functools
  import logging
  import math
  import torch
  import torch.nn.functional
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.modules.layers import ClassifierLayer
  from mmf.utils.build import build_image_encoder
  from omegaconf import OmegaConf
  from torch import nn
label_desc: Use image node_id 1 to create a new OcrPtrNet object from inherited base classes: nn with example: obj = OcrPtrNet(hidden_size, query_key_size)