def forward(self, data: Dict[(str, torch.Tensor)]) -> Dict[(str, torch.Tensor)]:
    'Perform a forward pass on the EA-LSTM model.\n\n        Parameters\n        ----------\n        data : Dict[str, torch.Tensor]\n            Dictionary, containing input features as key-value pairs.\n\n        Returns\n        -------\n        Dict[str, torch.Tensor]\n            Model outputs and intermediate states as a dictionary. \n                - `y_hat`: model predictions of shape [batch size, sequence length, number of target variables].\n                - `h_n`: hidden state at the last time step of the sequence of shape \n                    [batch size, sequence length, number of target variables].\n                - `c_n`: cell state at the last time step of the sequence of shape \n                    [batch size, sequence length, number of target variables].\n        '
    x_d = data['x_d'].transpose(0, 1)
    if (('x_s' in data) and ('x_one_hot' in data)):
        x_s = torch.cat([data['x_s'], data['x_one_hot']], dim=(- 1))
    elif ('x_s' in data):
        x_s = data['x_s']
    elif ('x_one_hot' in data):
        x_s = data['x_one_hot']
    else:
        raise ValueError('Need x_s or x_one_hot in forward pass.')
    h_t = x_d.data.new(x_d.shape[1], self._hidden_size).zero_()
    c_t = x_d.data.new(x_d.shape[1], self._hidden_size).zero_()
    (h_n, c_n) = ([], [])
    i = torch.sigmoid(self.input_gate(x_s))
    for x_dt in x_d:
        (h_t, c_t) = self._cell(x_dt, i, (h_t, c_t))
        h_n.append(h_t)
        c_n.append(c_t)
    h_n = torch.stack(h_n, 0).transpose(0, 1)
    c_n = torch.stack(c_n, 0).transpose(0, 1)
    pred = {'h_n': h_n, 'c_n': c_n}
    pred.update(self.head(self.dropout(h_n)))
    return pred
Perform a forward pass on the EA-LSTM model.

Parameters
----------
data : Dict[str, torch.Tensor]
    Dictionary, containing input features as key-value pairs.

Returns
-------
Dict[str, torch.Tensor]
    Model outputs and intermediate states as a dictionary. 
        - `y_hat`: model predictions of shape [batch size, sequence length, number of target variables].
        - `h_n`: hidden state at the last time step of the sequence of shape 
            [batch size, sequence length, number of target variables].
        - `c_n`: cell state at the last time step of the sequence of shape 
            [batch size, sequence length, number of target variables].
def forward(self, data: Dict[(str, torch.Tensor)]) -> Dict[(str, torch.Tensor)]:
    'Perform a forward pass on the EA-LSTM model.\n\n        Parameters\n        ----------\n        data : Dict[str, torch.Tensor]\n            Dictionary, containing input features as key-value pairs.\n\n        Returns\n        -------\n        Dict[str, torch.Tensor]\n            Model outputs and intermediate states as a dictionary. \n                - `y_hat`: model predictions of shape [batch size, sequence length, number of target variables].\n                - `h_n`: hidden state at the last time step of the sequence of shape \n                    [batch size, sequence length, number of target variables].\n                - `c_n`: cell state at the last time step of the sequence of shape \n                    [batch size, sequence length, number of target variables].\n        '
    x_d = data['x_d'].transpose(0, 1)
    if (('x_s' in data) and ('x_one_hot' in data)):
        x_s = torch.cat([data['x_s'], data['x_one_hot']], dim=(- 1))
    elif ('x_s' in data):
        x_s = data['x_s']
    elif ('x_one_hot' in data):
        x_s = data['x_one_hot']
    else:
        raise ValueError('Need x_s or x_one_hot in forward pass.')
    h_t = x_d.data.new(x_d.shape[1], self._hidden_size).zero_()
    c_t = x_d.data.new(x_d.shape[1], self._hidden_size).zero_()
    (h_n, c_n) = ([], [])
    i = torch.sigmoid(self.input_gate(x_s))
    for x_dt in x_d:
        (h_t, c_t) = self._cell(x_dt, i, (h_t, c_t))
        h_n.append(h_t)
        c_n.append(c_t)
    h_n = torch.stack(h_n, 0).transpose(0, 1)
    c_n = torch.stack(c_n, 0).transpose(0, 1)
    pred = {'h_n': h_n, 'c_n': c_n}
    pred.update(self.head(self.dropout(h_n)))
    return pred