class_docstr: Self Attention and FFN Unit
class_docstr_tok: ["Self","Attention","and","FFN","Unit"]
code: def __init__(self, config, ext_layer=False):
      super().__init__()
      self.self_attn = GPTSanJapaneseLayerSelfAttention(config)
      self.feed_forward = (
          GPTSanJapaneseLayerDenseFF(config)
          if ext_layer
          else GPTSanJapaneseLayerSparseFF(config)
      )
  
imports: import copy
  from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn
  from ...activations import ACT2FN
  from ...modeling_outputs import MoECausalLMOutputWithPast, MoEModelOutputWithPastAndCrossAttentions
  from ...modeling_utils import PreTrainedModel
  from ...utils import DUMMY_INPUTS, DUMMY_MASK, add_start_docstrings, add_start_docstrings_to_model_forward, is_torch_fx_proxy, logging
  from .configuration_gptsan_japanese import GPTSanJapaneseConfig
label_desc: Use image node_id 1 to create a new GPTSanJapaneseBlock object from inherited base classes: nn with example: obj = GPTSanJapaneseBlock(config, ext_layer)