Skip to content

Commit 3031b03

Browse files
ssnlPenghuiCheng
authored andcommitted
Update variable view note
Summary: Pull Request resolved: pytorch#11393 Differential Revision: D9725444 Pulled By: SsnL fbshipit-source-id: b1607d986ab93e64b0b0ff9e8f10d9e3f6e2160e
1 parent 99acfaf commit 3031b03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

torch/csrc/autograd/variable.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ struct Function;
5959
/// which case it tracks that `Variable`'s data and autograd history. Beyond
6060
/// construction, the interface of a view is identical to that of a regular
6161
/// `Variable`. You can determine whether `Variable` is in fact a view by
62-
/// probing its `is_view()` method.
62+
/// probing its `is_view()` method. Note that the *view* semantics are only
63+
/// meaningful for `Variable` relations that are relevant to autograd. For
64+
/// example, if you hide your code from autograd using `.data`, the `Variable`s
65+
/// will not be registered as having view relations, even if they share storage.
66+
///
6367
///
6468
/// Interface
6569
///~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)