Skip to content

Commit 3f64bc5

Browse files
committed
Update memory.md
1 parent 5ebaaf9 commit 3f64bc5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docfx/articles/memory.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ class MyDataset : torch.utils.data.Dataset
395395
}
396396
```
397397

398+
Also, if you want a "`Lazy`" collate function, do not directly save the tensors that are passed in. And `DetachFromDisposeScope` does not work in this case because they have been moved to another list. Instead, you could create aliases for them.
399+
398400
## Links and resources
399401

400402
These articles might give you ides about techniques to use to analyse memory. The code is in python but generally will translate across:

0 commit comments

Comments
 (0)