class_docstr: fastNLP中各种Embedding的基类
class_docstr_tok: ["fastNLP\u4e2d\u5404\u79cdEmbedding\u7684\u57fa\u7c7b"]
docstr: Embedding的参数是否允许优化。True: 所有参数运行优化; False: 所有参数不允许优化; None: 部分允许优化、部分不允许
  :return:
docstr_tok: ["Embedding\u7684\u53c2\u6570\u662f\u5426\u5141\u8bb8\u4f18\u5316\u3002True",":","\u6240\u6709\u53c2\u6570\u8fd0\u884c\u4f18\u5316",";","False",":","\u6240\u6709\u53c2\u6570\u4e0d\u5141\u8bb8\u4f18\u5316",";","None",":","\u90e8\u5206\u5141\u8bb8\u4f18\u5316\u3001\u90e8\u5206\u4e0d\u5141\u8bb8",":","return",":"]
code: def requires_grad(self):
      r"""
      Embedding的参数是否允许优化。True: 所有参数运行优化; False: 所有参数不允许优化; None: 部分允许优化、部分不允许
      :return:
      """
      requires_grads = set(
          [param.requires_grad for param in self.parameters()]
      )
      if len(requires_grads) == 1:
          return requires_grads.pop()
      else:
          return None
  
imports: from abc import abstractmethod
  from typing import Union, Tuple
  from ...envs.imports import _NEED_IMPORT_TORCH
  import numpy
  from .utils import get_embeddings
label_desc: Use image node_id 4 for calling the TokenEmbedding obj's underlying member method code with example usage: obj.requires_grad() and returns: requires_grads, None