Skip to content

Commit a0692ac

Browse files
ezyangfacebook-github-bot
authored andcommitted
Assert that TracingContext is available when set_example_value is called (#124284)
Summary: Signed-off-by: Edward Z. Yang <[email protected]> X-link: pytorch/pytorch#124284 Approved by: https://github.com/Chillee ghstack dependencies: #124105, #124059, #124176, #124283 Reviewed By: jeanschmidt Differential Revision: D56408587 Pulled By: ezyang fbshipit-source-id: 00772f4e4dd2b323116861626570c04591fbf7ec
1 parent 3f146bb commit a0692ac

File tree

1 file changed

+2
-0
lines changed
  • userbenchmark/dynamo/dynamobench/_dynamo

1 file changed

+2
-0
lines changed

userbenchmark/dynamo/dynamobench/_dynamo/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
import torch.utils._pytree as pytree
9696
from torch import fx
9797
from torch._dispatch.python import enable_python_dispatcher
98+
from torch._guards import TracingContext
9899
from torch._subclasses.meta_utils import is_sparse_compressed
99100
from torch._utils_internal import log_compilation_event
100101

@@ -1152,6 +1153,7 @@ def set_example_value(node, example_value):
11521153
# this to accurately reflect what the state of the value was at the time
11531154
# the program was traced).
11541155
node.meta["example_value"] = example_value
1156+
assert TracingContext.try_get() is not None
11551157

11561158

11571159
def _get_fake_tensor(vt):

0 commit comments

Comments
 (0)