code: def generate_emb_layer(ls_emb_config):
      layer = TransformerEmbeddingLayer(ls_emb_config)
      dtype = torch.float16 if ls_emb_config.fp16 else torch.float32
      layer.to(torch.device("cuda:0"), dtype=dtype)
  
      return layer
  
file_path: lightseq/tests/fairseq_layers.py
imports: from typing import Dict, List, Optional, Callable
  import math
  from copy import deepcopy
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.modules import LayerNorm, MultiheadAttention
  from fairseq.modules.fairseq_dropout import FairseqDropout
  from fairseq.modules.quant_noise import quant_noise
  from torch import Tensor
  from lightseq.training.ops.pytorch import TransformerEncoderLayer, TransformerDecoderLayer, TransformerEmbeddingLayer
label_desc: Use image node_id 4 for calling a global function with example usage: generate_emb_layer(ls_emb_config) and returns: layer