code: def __init__(
      self,
      num_hidden: int,
      num_model: int,
      act_type: str,
      dropout: float,
      use_glu: bool = False,
      inference_only: bool = False,
      dtype: Optional[pt.dtype] = None,
      clamp_to_dtype: bool = False,
  ) -> None:
      super().__init__()
      self.use_glu = use_glu
      self.clamp_to_dtype = clamp_to_dtype
      self.ff1 = pt.nn.Linear(
          in_features=num_model, out_features=num_hidden, dtype=dtype
      )
      self.act = sockeye.layers.get_activation(act_type)
      if self.use_glu:
          self.linear = pt.nn.Linear(
              in_features=num_model,
              out_features=num_hidden,
              dtype=dtype,
          )
      self.drop = pt.nn.Dropout(p=dropout)
      self.ff2 = pt.nn.Linear(
          in_features=num_hidden, out_features=num_model, dtype=dtype
      )
  
imports: from dataclasses import dataclass
  from typing import Optional, Tuple
  import torch
  import sockeye.layers
  from sockeye import constants
  from .None import config
label_desc: Use image node_id 1 to create a new TransformerFeedForward object from inherited base classes: pt.nn with example: obj = TransformerFeedForward(num_hidden, num_model, act_type, dropout, use_glu, inference_only, dtype, clamp_to_dtype)