Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ccaaf4 commit 90e5b05Copy full SHA for 90e5b05
1 file changed
examples/imagenet/main_amp.py
@@ -300,8 +300,10 @@ def next(self):
300
torch.cuda.current_stream().wait_stream(self.stream)
301
input = self.next_input
302
target = self.next_target
303
- input.record_stream(torch.cuda.current_stream())
304
- target.record_stream(torch.cuda.current_stream())
+ if input is not None:
+ input.record_stream(torch.cuda.current_stream())
305
+ if target is not None:
306
+ target.record_stream(torch.cuda.current_stream())
307
self.preload()
308
return input, target
309
0 commit comments