(self, hidden_state)
Set all hidden states/cells, for decoding purpose
Set all hidden states/cells, for decoding purpose
Set all hidden states / cells for decoding purpose
def set_state(self, hidden_state):
        ''' Set all hidden states/cells, for decoding purpose'''
        device = next(self.parameters()).device
        if self.enable_cell:
            self.hidden_state = (hidden_state[0].to(
                device), hidden_state[1].to(device))
        else:
            self.hidden_state = hidden_state.to(device)
def set_state ( self , hidden_state ) : device = next ( self . parameters ( ) ) . device if self . enable_cell : self . hidden_state = ( hidden_state [ 0 ] . to ( device ) , hidden_state [ 1 ] . to ( device ) ) else : self . hidden_state = hidden_state . to ( device )