class_docstr:     The standard rnn for sequence decoder.
  Parameters
  ----------
  max_decoder_step: int
      The maximal decoding step.
  input_size: int
      The dimension for standard rnn decoder's input.
  hidden_size: int
      The dimension for standard rnn decoder's hidden representation during calculation.
  word_emb: torch.nn.Embedding
      The target's embedding matrix.
  vocab: Any
      The target's vocabulary
  rnn_type: str, option=["lstm", "gru"], default="lstm"
      The rnn's type. We support ``lstm`` and ``gru`` here.
  use_attention: bool, default=True
      Whether use attention during decoding.
  attention_type: str, option=["uniform", "sep_diff_encoder_type", sep_diff_node_type], default="uniform" # noqa
      The attention strategy choice.
      "``uniform``": uniform attention. We will attend on the nodes uniformly.
      "``sep_diff_encoder_type``": separate attention.
          We will attend on graph encoder and rnn encoder's results separately.
      "``sep_diff_node_type``": separate attention.
          We will attend on different node type separately.
  
  attention_function: str, option=["general", "mlp"], default="mlp"
      Different attention function.
  node_type_num: int, default=None
      When we choose "``sep_diff_node_type``", we must set this parameter.
      This parameter indicate the the amount of node type.
  fuse_strategy: str, option=["average", "concatenate"], default=average
      The strategy to fuse attention results generated by separate attention.
      "``average``": We will take an average on all results.
      "``concatenate``": We will concatenate all results to one.
  use_copy: bool, default=False
      Whether use ``copy`` mechanism. See pointer network. Note that you must use attention first.
  use_coverage: bool, default=False
      Whether use ``coverage`` mechanism. Note that you must use attention first.
  coverage_strategy: str, option=["sum", "max"], default="sum"
      The coverage strategy when calculating the coverage vector.
  tgt_emb_as_output_layer: bool, default=False
      When this option is set ``True``, the output projection layer(It is used to project RNN encoded # noqa
      representation to target sequence)'s weight will be shared with the target vocabulary's embedding. # noqa
  dropout: float, default=0.3
class_docstr_tok: ["The","standard","rnn","for","sequence","decoder",".","Parameters","--","--","--","--","--","max_decoder_step",":","int","The","maximal","decoding","step",".","input_size",":","int","The","dimension","for","standard","rnn","decoder","'s","input",".","hidden_size",":","int","The","dimension","for","standard","rnn","decoder","'s","hidden","representation","during","calculation",".","word_emb",":","torch.nn.Embedding","The","target","'s","embedding","matrix",".","vocab",":","Any","The","target","'s","vocabulary","rnn_type",":","str",",","option=","[","``","lstm","''",",","``","gru","''","]",",","default=","''","lstm","''","The","rnn","'s","type",".","We","support","``","lstm","``","and","``","gru","``","here",".","use_attention",":","bool",",","default=True","Whether","use","attention","during","decoding",".","attention_type",":","str",",","option=","[","``","uniform","''",",","``","sep_diff_encoder_type","''",",","sep_diff_node_type","]",",","default=","''","uniform","''","#","noqa","The","attention","strategy","choice",".","``","``","uniform","``","``",":","uniform","attention",".","We","will","attend","on","the","nodes","uniformly",".","``","``","sep_diff_encoder_type","``","``",":","separate","attention",".","We","will","attend","on","graph","encoder","and","rnn","encoder","'s","results","separately",".","``","``","sep_diff_node_type","``","``",":","separate","attention",".","We","will","attend","on","different","node","type","separately",".","attention_function",":","str",",","option=","[","``","general","''",",","``","mlp","''","]",",","default=","''","mlp","''","Different","attention","function",".","node_type_num",":","int",",","default=None","When","we","choose","``","``","sep_diff_node_type","``","``",",","we","must","set","this","parameter",".","This","parameter","indicate","the","the","amount","of","node","type",".","fuse_strategy",":","str",",","option=","[","``","average","''",",","``","concatenate","''","]",",","default=average","The","strategy","to","fuse","attention","results","generated","by","separate","attention",".","``","``","average","``","``",":","We","will","take","an","average","on","all","results",".","``","``","concatenate","``","``",":","We","will","concatenate","all","results","to","one",".","use_copy",":","bool",",","default=False","Whether","use","``","copy","``","mechanism",".","See","pointer","network",".","Note","that","you","must","use","attention","first",".","use_coverage",":","bool",",","default=False","Whether","use","``","coverage","``","mechanism",".","Note","that","you","must","use","attention","first",".","coverage_strategy",":","str",",","option=","[","``","sum","''",",","``","max","''","]",",","default=","''","sum","''","The","coverage","strategy","when","calculating","the","coverage","vector",".","tgt_emb_as_output_layer",":","bool",",","default=False","When","this","option","is","set","``","True","``",",","the","output","projection","layer","(","It","is","used","to","project","RNN","encoded","#","noqa","representation","to","target","sequence",")","'s","weight","will","be","shared","with","the","target","vocabulary","'s","embedding",".","#","noqa","dropout",":","float",",","default=0.3"]
code: def _filter_oov(self, tokens):
      ret = tokens.clone()
      ret[tokens >= self.vocab_size] = self.vocab.UNK
      return ret
  
file_path: graph4nlp/graph4nlp/pytorch/modules/prediction/generation/StdRNNDecoder.py
imports: import random
  from functools import reduce
  import torch
  import torch.nn
  from graph4nlp.pytorch.modules.prediction.generation.attention import Attention
  from graph4nlp.pytorch.modules.prediction.generation.base import RNNDecoderBase
  from graph4nlp.pytorch.modules.utils.vocab_utils import Vocab
label_desc: Use image node_id 7 for calling the StdRNNDecoder obj's underlying member method code with example usage: obj._filter_oov(tokens) and returns: ret