Skip to content

Commit

Permalink
Update CpuLstmModel.py
Browse files Browse the repository at this point in the history
fixed an interface issue so now it has the same interface as other models.
  • Loading branch information
chaopengshen authored Dec 2, 2023
1 parent c39a815 commit 032fbe8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hydroDL/model/rnn/CpuLstmModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ def forward(self, inputs, doDropMC=False):
# return out
results = {}
x = inputs
# x = inputs["xTrain"]
nt, ngrid, nx = x.shape
yt = torch.zeros(ngrid, 1)
results["yP"] = torch.zeros(nt, ngrid, self.ny)
results = torch.zeros(nt, ngrid, self.ny)
ht = None
ct = None
resetMask = True
Expand All @@ -46,5 +45,5 @@ def forward(self, inputs, doDropMC=False):
ht, ct = self.lstm(x0, hidden=(ht, ct), resetMask=resetMask)
yt = self.linearOut(ht)
resetMask = False
results["yP"][t, :, :] = yt
results[t, :, :] = yt
return results

0 comments on commit 032fbe8

Please sign in to comment.