class_docstr: Generate decoder states by using a translation model to force-decode a parallel dataset.
  
  :param model: Sockeye translation model used to generate the states.
  :param source_vocabs: source vocabs for the translation model.
  :param target_vocabs: target vocabs for the translation model.
  :param output_dir: path to the memmap (directory) storing decoder states.
  :param max_seq_len_source: maximum source length for decoding.
  :param max_seq_len_target: maximum source length for decoding.
  :param state_data_type: data type for storing decoder states.
  :param word_data_type: data type for storing word indexes.
  :param device: device (cpu/gpu) for decoding.
class_docstr_tok: ["Generate","decoder","states","by","using","a","translation","model","to","force-decode","a","parallel","dataset",".",":","param","model",":","Sockeye","translation","model","used","to","generate","the","states",".",":","param","source_vocabs",":","source","vocabs","for","the","translation","model",".",":","param","target_vocabs",":","target","vocabs","for","the","translation","model",".",":","param","output_dir",":","path","to","the","memmap","(","directory",")","storing","decoder","states",".",":","param","max_seq_len_source",":","maximum","source","length","for","decoding",".",":","param","max_seq_len_target",":","maximum","source","length","for","decoding",".",":","param","state_data_type",":","data","type","for","storing","decoder","states",".",":","param","word_data_type",":","data","type","for","storing","word","indexes",".",":","param","device",":","device","(","cpu\/gpu",")","for","decoding","."]
code: def __init__(
      self,
      model: SockeyeModel,
      source_vocabs: List[Vocab],
      target_vocabs: List[Vocab],
      output_dir: str,
      max_seq_len_source: int,
      max_seq_len_target: int,
      state_data_type: str,
      word_data_type: str,
      device: pt.device,
  ) -> None:
      self.model = model
      self.source_vocabs = source_vocabs
      self.target_vocabs = target_vocabs
      self.device = device
      self.traced_model = None
      self.max_seq_len_source = max_seq_len_source
      self.max_seq_len_target = max_seq_len_target
  
      self.output_dir = output_dir
      self.state_store_file = None  # type: Optional[NumpyMemmapStorage]
      self.words_store_file = None  # type: Optional[NumpyMemmapStorage]
  
      # info for KNNConfig
      self.num_states = 0
      self.dimension = None  # type: Optional[int]
      self.state_data_type = utils.get_numpy_dtype(state_data_type)
      self.word_data_type = utils.get_numpy_dtype(word_data_type)
  
imports: import argparse
  import logging
  import os
  from typing import List, Optional
  import numpy
  import torch
  from .None import arguments
  from .None import constants
  from .None import data_io
  from .None import utils
  from .log import setup_main_logger
  from .model import SockeyeModel, load_model
  from .vocab import Vocab
  from .utils import check_condition
  from .knn import KNNConfig, get_state_store_path, get_word_store_path, get_config_path
label_desc: Use image node_id 1 to create a new DecoderStateGenerator object  with example: obj = DecoderStateGenerator(model, source_vocabs, target_vocabs, output_dir, max_seq_len_source, max_seq_len_target, state_data_type, word_data_type, device)