InitState¶
- class paddle.fluid.contrib.decoder.beam_search_decoder. InitState ( init=None, shape=None, value=0.0, init_boot=None, need_reorder=False, dtype='float32' ) [source]
- 
         The initial hidden state object. The state objects holds a variable, and may use it to initialize the hidden state cell of RNN. Usually used as input to StateCell class. - Parameters
- 
           - init (Variable) – The initial variable of the hidden state. If set None, the variable will be created as a tensor with constant value based on shape and value param. 
- shape (tuple|list) – If init is None, new Variable’s shape. Default None. 
- value (float) – If init is None, new Variable’s value. Default None. 
- init_boot (Variable) – If provided, the initial variable will be created with the same shape as this variable. 
- need_reorder (bool) – If set true, the init will be sorted by its lod rank within its batches. This should be used if batch_size > 1. 
- dtype (np.dtype|core.VarDesc.VarType|str) – Data type of the initial variable. 
 
- Returns
- 
           An initialized state object. 
 Examples See StateCell. 
