class_docstr: Universal Transformer(https://arxiv.org/pdf/1807.03819.pdf) with ACT(https://arxiv.org/pdf/1603.08983.pdf).
code: def __init__(
      self,
      encoder,
      decoder,
      src_embed,
      tgt_embed,
      pos_enc,
      time_enc,
      generator,
      h,
      d_k,
  ):
      super(UTransformer, self).__init__()
      self.encoder, self.decoder = encoder, decoder
      self.src_embed, self.tgt_embed = src_embed, tgt_embed
      self.pos_enc, self.time_enc = pos_enc, time_enc
      self.halt_enc = HaltingUnit(h * d_k)
      self.halt_dec = HaltingUnit(h * d_k)
      self.generator = generator
      self.h, self.d_k = h, d_k
      self.reset_stat()
  
imports: from .attention import *
  from .layers import *
  from .functions import *
  from .embedding import *
  import dgl.function
  import torch
  import torch.nn.init
label_desc: Use image node_id 1 to create a new UTransformer object from inherited base classes: nn with example: obj = UTransformer(encoder, decoder, src_embed, tgt_embed, pos_enc, time_enc, generator, h, d_k)