code: def get_bind_decoder_output_embed(embed):
      """
      给定一个embedding，输出对应的绑定的embedding，输出对象为TiedEmbedding
  
      :param embed:
      :return:
      """
      if isinstance(embed, StaticEmbedding):
          for idx, map2idx in enumerate(embed.words_to_words):
              assert idx == map2idx, (
                  "Invalid StaticEmbedding for Decoder, please check:(1) whether the vocabulary "
                  "include `no_create_entry=True` word; (2) StaticEmbedding should  not initialize with "
                  "`lower=True` or `min_freq!=1`."
              )
      elif not isinstance(embed, nn.Embedding):
          raise TypeError(
              "Only nn.Embedding or StaticEmbedding is allowed for binding."
          )
  
      return TiedEmbedding(embed.weight)
  
imports: from typing import Union, Tuple
  import math
  import torch
  from torch import nn
  import torch.nn.functional
  from ..attention import AttentionLayer, MultiHeadAttention
  from ....embeddings.torch.utils import get_embeddings
  from ....embeddings.torch.static_embedding import StaticEmbedding
  from .seq2seq_state import State, LSTMState, TransformerState
label_desc: Use image node_id 1 for calling a global function with example usage: get_bind_decoder_output_embed(embed) and returns: TiedEmbedding