code: def _apply_word_emb(word_emb_enc, emb_char, word_emb):
      """
      Concatenates character and word embeddings together, possibly
      applying a custom encoding/transformation
  
      Arguments
      ---------
      word_emb_enc: callable
          an encoder to apply (typically, speechbrain.lobes.models.g2p.model.WordEmbeddingEncoder)
      emb_char: torch.Tensor
          character embeddings
      word_emb: char
          word embeddings
  
      Returns
      -------
      result: torch.Tensor
          the resulting (concatenated) tensor
      """
      word_emb_enc = (
          word_emb_enc(word_emb.data)
          if word_emb_enc is not None
          else word_emb.data
      )
      return torch.cat([emb_char, word_emb_enc], dim=-1)
  
imports: from speechbrain.lobes.models.transformer.Transformer import TransformerInterface, get_lookahead_mask, get_key_padding_mask
  import torch
  from torch import nn
  from speechbrain.nnet.linear import Linear
  from speechbrain.nnet import normalization
label_desc: Use image node_id 2 for calling a global function with example usage: _apply_word_emb(word_emb_enc, emb_char, word_emb) and returns: torch