code: def __init__(
      self,
      in_dim: int,
      out_dim: int,
      *,
      bias: Optional[bool] = None,
      pruner_config: Optional[dict] = None,
      dropout: float = 0.0,
      batch_norm: bool = True,
      activation: Optional[str] = "ReLU",
      init_method: str = "xavier_normal",
  ):
      super().__init__()
      self.linear_mapping = Linear(
          in_dim,
          out_dim,
          bias=True if bias is None else bias,
          pruner_config=pruner_config,
          init_method=init_method,
      )
      self.nonlinear_mapping = Mapping(
          in_dim,
          out_dim,
          bias=bias,
          pruner_config=pruner_config,
          dropout=dropout,
          batch_norm=batch_norm,
          activation=activation,
          init_method=init_method,
      )
      self.gate_linear = Linear(
          in_dim,
          out_dim,
          bias=True if bias is None else bias,
          pruner_config=pruner_config,
          init_method=init_method,
      )
      self.sigmoid = nn.Sigmoid()
  
imports: import torch.nn
  from torch import Tensor
  from typing import Any
  from typing import Dict
  from typing import Type
  from typing import Optional
  from torch.nn import Module
  from cftool.misc import WithRegister
  from .norms import BN
  from .customs import Linear
  from .activations import Activation
label_desc: Use image node_id 1 to create a new HighwayBlock object from inherited base classes: MappingBase with example: obj = HighwayBlock(in_dim, out_dim)