class_docstr: Implements an 'n-tower' MLPDecoder
code: def get_mlp(
      from_dim: int,
      to_dim: int,
      hidden_dims: List[int],
      layer_norm: bool,
      dropout: float,
      activation: Activation,
      export_embedding: bool = False,
  ):
      layers = []
      for i in range(len(hidden_dims)):
          dim = hidden_dims[i]
          layers.append(nn.Linear(from_dim, dim, True))
          # Skip ReLU, LayerNorm, and dropout for the last layer if export_embedding
          if not (export_embedding and i == len(hidden_dims) - 1):
              layers.append(get_activation(activation))
              if layer_norm:
                  layers.append(nn.LayerNorm(dim))
              if dropout > 0:
                  layers.append(nn.Dropout(dropout))
          from_dim = dim
  
      if to_dim > 0:
          layers.append(nn.Linear(from_dim, to_dim, True))
  
      return nn.Sequential(*layers)
  
file_path: pytext/pytext/models/decoders/mlp_decoder_n_tower.py
imports: from typing import List
  import torch
  import torch.nn
  from pytext.config.module_config import Activation
  from pytext.models.decoders.decoder_base import DecoderBase
  from pytext.optimizer import get_activation
  from pytext.utils import precision
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 2 for calling the MLPDecoderNTower obj's underlying member method code with example usage: obj.get_mlp(from_dim, to_dim, hidden_dims, layer_norm, dropout, activation, export_embedding) and returns: nn