(self, hidden_size, rnnstate)
Args:
            hidden_size (int): the size of hidden layer of the decoder.
            rnnstate: final hidden state from the encoder.
                transformed to shape: layers x batch x (directions*dim).
Args:
            hidden_size (int): the size of hidden layer of the decoder.
            rnnstate: final hidden state from the encoder.
                transformed to shape: layers x batch x (directions*dim).
Args : hidden_size ( int ) : the size of hidden layer of the decoder . rnnstate : final hidden state from the encoder . transformed to shape : layers x batch x ( directions * dim ) .
def __init__(self, hidden_size, rnnstate):
        """
        Args:
            hidden_size (int): the size of hidden layer of the decoder.
            rnnstate: final hidden state from the encoder.
                transformed to shape: layers x batch x (directions*dim).
        """
        if not isinstance(rnnstate, tuple):
            self.hidden = (rnnstate,)
        else:
            self.hidden = rnnstate
        self.coverage = None

        # Init the input feed.
        batch_size = self.hidden[0].size(1)
        h_size = (batch_size, hidden_size)
        self.input_feed = self.hidden[0].data.new(*h_size).zero_() \
                              .unsqueeze(0)
def __init__ ( self , hidden_size , rnnstate ) : if not isinstance ( rnnstate , tuple ) : self . hidden = ( rnnstate , ) else : self . hidden = rnnstate self . coverage = None # Init the input feed. batch_size = self . hidden [ 0 ] . size ( 1 ) h_size = ( batch_size , hidden_size ) self . input_feed = self . hidden [ 0 ] . data . new ( * h_size ) . zero_ ( ) . unsqueeze ( 0 )