class_docstr: Generic decoder interface.
  A decoder needs to implement code to decode a target sequence known in advance (decode_sequence),
  and code to decode a single word given its decoder state (decode_step).
  The latter is typically used for inference graphs in beam search.
  For the inference module to be able to keep track of decoder's states
  a decoder provides methods to return initial states (init_states), state variables and their shapes.
docstr: Registers decoder type for configuration. Suffix is appended to decoder prefix.
  
  :param config_type: Configuration type for decoder.
  
  :return: Class decorator.
docstr_tok: ["Registers","decoder","type","for","configuration",".","Suffix","is","appended","to","decoder","prefix",".",":","param","config_type",":","Configuration","type","for","decoder",".",":","return",":","Class","decorator","."]
code: def register(cls, config_type: Type[DecoderConfig]):
      """
      Registers decoder type for configuration. Suffix is appended to decoder prefix.
  
      :param config_type: Configuration type for decoder.
  
      :return: Class decorator.
      """
  
      def wrapper(target_cls):
          cls.__registry[config_type] = target_cls
          return target_cls
  
      return wrapper
  
imports: import logging
  from abc import abstractmethod
  from itertools import islice
  from typing import Dict, List, Optional, Tuple, Type, Union
  import torch
  from .None import constants
  from .None import layers
  from .None import transformer
  from .transformer import TransformerConfig
label_desc: Use image node_id 1 for calling the Decoder obj's underlying member method code with example usage: obj.register(cls, config_type) and returns: wrapper, target_cls