docstr: A simple conversion of the ProphetNet Encoder layer to its `BetterTransformer` implementation.
  
  Args:
      prophet_net_layer (`torch.nn.Module`):
          The original ProphetNet Layer where the weights needs to be retrieved.
code: def __init__(self, prophetnet_layer, config):
      r"""
      A simple conversion of the ProphetNet Encoder layer to its `BetterTransformer` implementation.
  
      Args:
          prophet_net_layer (`torch.nn.Module`):
              The original ProphetNet Layer where the weights needs to be retrieved.
      """
      super().__init__(config)
      super(BetterTransformerBaseLayer, self).__init__()
      self.config = config
      # In_proj layer
      self.in_proj_weight = nn.Parameter(
          torch.cat(
              [
                  prophetnet_layer.self_attn.query_proj.weight,
                  prophetnet_layer.self_attn.key_proj.weight,
                  prophetnet_layer.self_attn.value_proj.weight,
              ]
          )
      )
      self.in_proj_bias = nn.Parameter(
          torch.cat(
              [
                  prophetnet_layer.self_attn.query_proj.bias,
                  prophetnet_layer.self_attn.key_proj.bias,
                  prophetnet_layer.self_attn.value_proj.bias,
              ]
          )
      )
  
      # Out proj layer
      self.out_proj_weight = prophetnet_layer.self_attn.out_proj.weight
      self.out_proj_bias = prophetnet_layer.self_attn.out_proj.bias
  
      # Linear layer 1
      self.linear1_weight = (
          prophetnet_layer.feed_forward.intermediate.weight
      )
      self.linear1_bias = (
          prophetnet_layer.feed_forward.intermediate.bias
      )
  
      # Linear layer 2
      self.linear2_weight = prophetnet_layer.feed_forward.output.weight
      self.linear2_bias = prophetnet_layer.feed_forward.output.bias
  
      # Layer norm 1
      self.norm1_eps = prophetnet_layer.self_attn_layer_norm.eps
      self.norm1_weight = prophetnet_layer.self_attn_layer_norm.weight
      self.norm1_bias = prophetnet_layer.self_attn_layer_norm.bias
  
      # Layer norm 2
      self.norm2_eps = prophetnet_layer.feed_forward_layer_norm.eps
      self.norm2_weight = (
          prophetnet_layer.feed_forward_layer_norm.weight
      )
      self.norm2_bias = prophetnet_layer.feed_forward_layer_norm.bias
  
      # Model hyper parameters
      self.num_heads = prophetnet_layer.self_attn.num_attn_heads
      self.embed_dim = (
          prophetnet_layer.self_attn.head_dim * self.num_heads
      )
  
      # Last step: set the last layer to `False` -> this will be set to `True` when converting the model
      self.is_last_layer = False
  
      self.original_layers_mapping = {
          "in_proj_weight": [
              "self_attn.query_proj.weight",
              "self_attn.key_proj.weight",
              "self_attn.value_proj.weight",
          ],
          "in_proj_bias": [
              "self_attn.query_proj.bias",
              "self_attn.key_proj.bias",
              "self_attn.value_proj.bias",
          ],
          "out_proj_weight": "self_attn.out_proj.weight",
          "out_proj_bias": "self_attn.out_proj.bias",
          "linear1_weight": "feed_forward.intermediate.weight",
          "linear1_bias": "feed_forward.intermediate.bias",
          "linear2_weight": "feed_forward.output.weight",
          "linear2_bias": "feed_forward.output.bias",
          "norm1_weight": "self_attn_layer_norm.weight",
          "norm1_bias": "self_attn_layer_norm.bias",
          "norm2_weight": "feed_forward_layer_norm.weight",
          "norm2_bias": "feed_forward_layer_norm.bias",
      }
  
      self.validate_bettertransformer()
  
imports: from typing import TYPE_CHECKING
  import torch
  import torch.nn
  import torch.nn.functional
  from transformers.activations import ACT2FN
  from .base import BetterTransformerBaseLayer
label_desc: Use image node_id 1 to create a new ProphetNetEncoderLayerBetterTransformer object from inherited base classes: BetterTransformerBaseLayer, nn with example: obj = ProphetNetEncoderLayerBetterTransformer(prophetnet_layer, config)