PyxLSTM icon indicating copy to clipboard operation
PyxLSTM copied to clipboard

RuntimeError: Boolean value of Tensor with more than one value is ambiguous in xLSTM/slstm.py

Open Harryyang21 opened this issue 1 year ago • 2 comments

RuntimeError: Boolean value of Tensor with more than one value is ambiguous in xLSTM/slstm.py

Issue Description

I'm encountering a RuntimeError when attempting to execute a backward pass in my xLSTM model. The error message is:

RuntimeError: Boolean value of Tensor with more than one value is ambiguous

This issue occurs in the slstm.py module, specifically at line 53 during a forward pass. Here's the relevant code snippet:

if i < self.num_layers - 1:
    # Further operations

It seems the variable i, which is expected to be an integer index, is somehow being interpreted as a tensor, leading to an ambiguous boolean condition in the if statement. This happens during the operation lstm_output, hidden_state = self.lstm(input_seq, hidden_state), suggesting that there might be an issue with how the LSTM output or hidden state is handled or initialized.

Request for Help Could someone help clarify what might be going wrong here or suggest modifications to avoid this issue? Any guidance would be greatly appreciated.

Thank you!

Harryyang21 avatar May 20 '24 03:05 Harryyang21

@muditbhargava66 This is actually a duplicate of the issue described here https://github.com/muditbhargava66/PyxLSTM/issues/4

Strawl avatar May 25 '24 11:05 Strawl

Stale issue message

github-actions[bot] avatar Jul 24 '24 18:07 github-actions[bot]