2024-12-12 04:48 AM
As stated, I have problem analyzing the ONNX model ported from a pytorch model. The code of the model is simple as follows:
class LSTM(nn.Module):
def __init__(self, input_size, hidden_size, num_layers, num_output=1):
super(LSTM, self).__init__()
self.num_layers = num_layers
self.input_size = input_size
self.hidden_size = hidden_size
self.num_output = num_output
self.lstm = nn.LSTM(input_size=input_size, hidden_size=hidden_size,
num_layers=num_layers, batch_first=True)
self.fc = nn.Linear(hidden_size, num_output)
def forward(self, x, device='cuda'):
ula, (h_out, _) = self.lstm(x)
out = self.fc(h_out[-1])
return out
Netron vis:
I will really appreciate any advice or workarounds. Thank you!
Solved! Go to Solution.
2024-12-18 07:31 AM
Thank you very much!