Skip to content

Commit

Permalink
Remove VariableTracker.propagate (#111726)
Browse files Browse the repository at this point in the history
Summary:
X-link: pytorch/pytorch#111726
Approved by: https://github.com/voznesenskym
ghstack dependencies: #111306, #111415, #111725

Reviewed By: PaliC

Differential Revision: D51101346

Pulled By: jansel

fbshipit-source-id: 382ba4c2ff37b29400ac3ef9b9e8862f87a08811
  • Loading branch information
jansel authored and facebook-github-bot committed Nov 8, 2023
1 parent 7fe795a commit 3c94416
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from pathlib import Path
from typing import Any, Dict, Optional, Set, Tuple, Union


try:
import numpy as np
except ModuleNotFoundError:
Expand Down Expand Up @@ -915,11 +916,13 @@ def enum_repr(value, local):
def _get_fake_tensor(vt):
fake_tensor = vt.as_proxy().node.meta.get("example_value")
if not is_fake(fake_tensor):
from .exc import unimplemented

unimplemented("Cannot check Tensor object identity without its fake value")
return fake_tensor


def iter_contains(items, search, tx, options, check_tensor_identity=False):
def iter_contains(items, search, tx, check_tensor_identity=False):
from .variables import BuiltinVariable, ConstantVariable, TensorVariable

if search.is_python_constant():
Expand All @@ -928,7 +931,7 @@ def iter_contains(items, search, tx, options, check_tensor_identity=False):
and x.as_python_constant() == search.as_python_constant()
for x in items
)
return ConstantVariable.create(found, **options)
return ConstantVariable.create(found)

must_check_tensor_id = False
if check_tensor_identity and isinstance(search, TensorVariable):
Expand Down

0 comments on commit 3c94416

Please sign in to comment.