code: def __init__(
      self,
      n_token,
      d_embed,
      d_proj,
      cutoffs,
      div_val=1,
      sample_softmax=False,
  ):
      super(AdaptiveEmbedding, self).__init__()
  
      self.n_token = n_token
      self.d_embed = d_embed
  
      self.cutoffs = cutoffs + [n_token]
      self.div_val = div_val
      self.d_proj = d_proj
  
      self.emb_scale = d_proj**0.5
  
      self.cutoff_ends = [0] + self.cutoffs
  
      self.emb_layers = nn.ModuleList()
      self.emb_projs = nn.ModuleList()
  
      if div_val == 1:
          self.emb_layers.append(
              nn.Embedding(n_token, d_embed, sparse=sample_softmax > 0)
          )
          if d_proj != d_embed:
              self.emb_projs.append(Projection(d_proj, d_embed))
      else:
          for i in range(len(self.cutoffs)):
              l_idx, r_idx = (
                  self.cutoff_ends[i],
                  self.cutoff_ends[i + 1],
              )
              d_emb_i = d_embed // (div_val**i)
              self.emb_layers.append(
                  nn.Embedding(r_idx - l_idx, d_emb_i)
              )
              self.emb_projs.append(Projection(d_proj, d_emb_i))
  
imports: import sys
  import math
  import functools
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from proj_adaptive_softmax import ProjectedAdaptiveLogSoftmax, Projection
  from log_uniform_sampler import LogUniformSampler, sample_logits
  from fmoe import FMoETransformerMLP
label_desc: Use image node_id 1 to create a new AdaptiveEmbedding object from inherited base classes: nn with example: obj = AdaptiveEmbedding(n_token, d_embed, d_proj, cutoffs, div_val, sample_softmax)