Skip to content

Commit 4794230

Browse files
ezyangsoumith
authored andcommitted
Comment that data of THStorage may be NULL.
Signed-off-by: Edward Z. Yang <[email protected]>
1 parent 6b69723 commit 4794230

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

torch/csrc/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ One important case where this assumption is important is when tracking
3030
the CUDA device a tensor is stored in: this information is stored
3131
solely in the storage, so if a storage is NULL, we lose this information.
3232

33+
Although storage is never NULL, the data field of THStorage may be NULL. This
34+
mostly occurs when we want to pre-allocate an output tensor struct, but then
35+
have it be resized and filled with data by some operator: there's no point in
36+
allocating data for it in this case!
37+
3338
## Files
3439

3540
### `Exceptions.h`

0 commit comments

Comments
 (0)