Skip to content

Commit

Permalink
Time performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
isvogor-foi authored Mar 23, 2022
1 parent 1c18d5e commit 8396aab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/supporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def last(self):
def append(self, x):
"""Add an element to the accumulator."""
if self.memory is None:
self.memory = torch.zeros(self.window_length, *x.shape)
self.memory = torch.zeros(self.window_length, *x.shape, x.device)

# ensure same device and type
if self.memory.device != x.device or self.memory.type() != x.type():
Expand Down

0 comments on commit 8396aab

Please sign in to comment.