Repository: pytorch
Issue: Real tensor prop for bool cast on x.eq().any() call fails export
Labels: triaged,oncall: pt2,module: dynamic shapes,oncall: export

### 🐛 Describe the bug

Minified repro for AOTInductor torchbench test (with real tensor prop wrapper on export call):
```
python benchmarks/dynamo/torchbench.py --accuracy --inference --bfloat16 --device cuda --export-aot-inductor --only cm3leon_generate
```

This toy example fails with real-tensor tracing mode. Surprisingly(?) it exports fine when the bool() cast is removed, even without real tensor prop:
```
class Foo(torch.nn.Module):
    def forward(self, x):
        return bool(x.eq(0.1).any())

model = Foo()
inputs = (torch.randn(64),)
with torch._functorch.config.patch(fake_tensor_propagate_real_tensors=True):
    ep = export(model, inputs, strict=False)
```

Output:
```
I0910 15:58:55.387000 2040540 torch/fx/experimental/symbolic_shapes.py:3317] create_unbacked_symbool u0 [0, 1] (_subclasses/fake_impls.py:392 in local_scalar_dense)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679] Data dependent variable 'u0' allocated at:
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/test/export/test_export.py", line 8136, in <module>
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     run_tests()
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/testing/_internal/common_utils.py", line 1273, in run_tests
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     unittest.main(argv=argv)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/main.py", line 101, in __init__
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     self.runTests()
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/main.py", line 271, in runTests
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     self.result = testRunner.run(self.test)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/runner.py", line 184, in run
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     test(result)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/suite.py", line 84, in __call__
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return self.run(*args, **kwds)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/suite.py", line 122, in run
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     test(result)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/suite.py", line 84, in __call__
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return self.run(*args, **kwds)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/suite.py", line 122, in run
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     test(result)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/case.py", line 650, in __call__
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return self.run(*args, **kwds)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/testing/_internal/common_utils.py", line 3112, in run
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     self._run_custom(
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/testing/_internal/common_utils.py", line 3084, in _run_custom
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     super_run(result=result)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/case.py", line 591, in run
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     self._callTestMethod(testMethod)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/home/pianpwk/.conda/envs/pytorch-3.10/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     method()
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/testing/_internal/common_utils.py", line 2979, in wrapper
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     method(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/test/export/test_export.py", line 1203, in test_crash_real_tensor_eq
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     ep = export(model, inputs, strict=False)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/export/__init__.py", line 273, in export
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return _export(
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 990, in wrapper
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     ep = fn(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/export/exported_program.py", line 114, in wrapper
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return fn(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 1880, in _export
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     export_artifact = export_func(  # type: ignore[operator]
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 1683, in _non_strict_export
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     aten_export_artifact = _to_aten_func(  # type: ignore[operator]
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 637, in _export_to_aten_ir
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     gm, graph_signature = transform(aot_export_module)(
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 1611, in _aot_export_non_strict
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     gm, sig = aot_export(wrapped_mod, args, kwargs=kwargs, **flags)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_functorch/aot_autograd.py", line 1246, in aot_export_module
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     fx_g, metadata, in_spec, out_spec = _aot_export_function(
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_functorch/aot_autograd.py", line 1480, in _aot_export_function
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     fx_g, meta = create_aot_dispatcher_function(
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_functorch/aot_autograd.py", line 522, in create_aot_dispatcher_function
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return _create_aot_dispatcher_function(
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_functorch/aot_autograd.py", line 623, in _create_aot_dispatcher_function
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     fw_metadata = run_functionalized_fw_and_collect_metadata(
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_functorch/_aot_autograd/collect_metadata_analysis.py", line 173, in inner
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     flat_f_outs = f(*flat_f_args)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_functorch/_aot_autograd/utils.py", line 182, in flat_fn
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     tree_out = fn(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_functorch/_aot_autograd/traced_function_transforms.py", line 863, in functional_call
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     out = mod(*args[params_len:], **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return self._call_impl(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/nn/modules/module.py", line 1747, in _call_impl
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return forward_call(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 1598, in forward
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     tree_out = self._export_root(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return self._call_impl(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/nn/modules/module.py", line 1747, in _call_impl
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return forward_call(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/test/export/test_export.py", line 1198, in forward
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return bool(x.eq(0.1).any())
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_export/non_strict_utils.py", line 520, in __torch_function__
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return func(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_subclasses/functional_tensor.py", line 534, in __torch_dispatch__
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     outs_unwrapped = func._op_dk(
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/utils/_stats.py", line 21, in wrapper
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return fn(*args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_subclasses/fake_tensor.py", line 1238, in __torch_dispatch__
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return self.dispatch(func, types, args, kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_subclasses/fake_tensor.py", line 1692, in dispatch
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return self._cached_dispatch_impl(func, types, args, kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_subclasses/fake_tensor.py", line 1348, in _cached_dispatch_impl
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     output = self._dispatch_impl(func, types, args, kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_subclasses/fake_tensor.py", line 1983, in _dispatch_impl
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     op_impl_out = op_impl(self, func, *args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_subclasses/fake_impls.py", line 147, in dispatch_to_op_implementations_dict
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return op_implementations_dict[func](fake_mode, func, *args, **kwargs)
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/_subclasses/fake_impls.py", line 392, in local_scalar_dense
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     r = fake_mode.shape_env.create_unbacked_symbool()
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]   File "/data/users/pianpwk/pytorch/torch/fx/experimental/recording.py", line 262, in wrapper
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679]     return retlog(fn(*args, **kwargs))
V0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:4679] 
W0910 15:58:55.411000 2040540 torch/fx/experimental/symbolic_shapes.py:5124] failed during evaluate_expr(Eq(u0, 1), hint=None, size_oblivious=False, forcing_spec=False
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] failed while running evaluate_expr(*(Eq(u0, 1), None), **{'fx_node': False})
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] Traceback (most recent call last):
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298]   File "/data/users/pianpwk/pytorch/torch/fx/experimental/recording.py", line 262, in wrapper
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298]     return retlog(fn(*args, **kwargs))
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298]   File "/data/users/pianpwk/pytorch/torch/fx/experimental/symbolic_shapes.py", line 5122, in evaluate_expr
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298]     return self._evaluate_expr(orig_expr, hint, fx_node, size_oblivious, forcing_spec=forcing_spec)
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298]   File "/data/users/pianpwk/pytorch/torch/fx/experimental/symbolic_shapes.py", line 5238, in _evaluate_expr
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298]     raise self._make_data_dependent_error(
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode: Could not guard on data-dependent expression Eq(u0, 1) (unhinted: Eq(u0, 1)).  (Size-like symbols: none)
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] 
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] Potential framework code culprit (scroll up for full backtrace):
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298]   File "/data/users/pianpwk/pytorch/torch/_export/non_strict_utils.py", line 520, in __torch_function__
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298]     return func(*args, **kwargs)
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] 
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] For more information, run with TORCH_LOGS="dynamic"
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] For extended logs when we create symbols, also add TORCHDYNAMO_EXTENDED_DEBUG_CREATE_SYMBOL="u0"
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] If you suspect the guard was triggered from C++, add TORCHDYNAMO_EXTENDED_DEBUG_CPP=1
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] For more debugging help, see https://docs.google.com/document/d/1HSuTTVvYH1pTew89Rtpeu84Ht3nQEFTYhAX3Ypa_xJs/edit?usp=sharing
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] 
E0910 15:58:55.412000 2040540 torch/fx/experimental/recording.py:298] For C++ stack trace, run with TORCHDYNAMO_EXTENDED_DEBUG_CPP=1
W0910 15:58:55.413000 2040540 torch/fx/experimental/symbolic_shapes.py:5554] Unable to find user code corresponding to {u0}
inductor []
E
======================================================================
ERROR: test_crash_real_tensor_eq (__main__.TestExport)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/users/pianpwk/pytorch/torch/testing/_internal/common_utils.py", line 2979, in wrapper
    method(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/test/export/test_export.py", line 1203, in test_crash_real_tensor_eq
    ep = export(model, inputs, strict=False)
  File "/data/users/pianpwk/pytorch/torch/export/__init__.py", line 273, in export
    return _export(
  File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 1017, in wrapper
    raise e
  File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 990, in wrapper
    ep = fn(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/torch/export/exported_program.py", line 114, in wrapper
    return fn(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 1880, in _export
    export_artifact = export_func(  # type: ignore[operator]
  File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 1683, in _non_strict_export
    aten_export_artifact = _to_aten_func(  # type: ignore[operator]
  File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 637, in _export_to_aten_ir
    gm, graph_signature = transform(aot_export_module)(
  File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 1611, in _aot_export_non_strict
    gm, sig = aot_export(wrapped_mod, args, kwargs=kwargs, **flags)
  File "/data/users/pianpwk/pytorch/torch/_functorch/aot_autograd.py", line 1246, in aot_export_module
    fx_g, metadata, in_spec, out_spec = _aot_export_function(
  File "/data/users/pianpwk/pytorch/torch/_functorch/aot_autograd.py", line 1480, in _aot_export_function
    fx_g, meta = create_aot_dispatcher_function(
  File "/data/users/pianpwk/pytorch/torch/_functorch/aot_autograd.py", line 522, in create_aot_dispatcher_function
    return _create_aot_dispatcher_function(
  File "/data/users/pianpwk/pytorch/torch/_functorch/aot_autograd.py", line 623, in _create_aot_dispatcher_function
    fw_metadata = run_functionalized_fw_and_collect_metadata(
  File "/data/users/pianpwk/pytorch/torch/_functorch/_aot_autograd/collect_metadata_analysis.py", line 173, in inner
    flat_f_outs = f(*flat_f_args)
  File "/data/users/pianpwk/pytorch/torch/_functorch/_aot_autograd/utils.py", line 182, in flat_fn
    tree_out = fn(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/torch/_functorch/_aot_autograd/traced_function_transforms.py", line 863, in functional_call
    out = mod(*args[params_len:], **kwargs)
  File "/data/users/pianpwk/pytorch/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/torch/export/_trace.py", line 1598, in forward
    tree_out = self._export_root(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/test/export/test_export.py", line 1198, in forward
    return bool(x.eq(0.1).any())
  File "/data/users/pianpwk/pytorch/torch/_export/non_strict_utils.py", line 520, in __torch_function__
    return func(*args, **kwargs)
  File "/data/users/pianpwk/pytorch/torch/fx/experimental/sym_node.py", line 449, in guard_bool
    r = self.shape_env.evaluate_expr(self.expr, self.hint, fx_node=self.fx_node)
  File "/data/users/pianpwk/pytorch/torch/fx/experimental/recording.py", line 262, in wrapper
    return retlog(fn(*args, **kwargs))
  File "/data/users/pianpwk/pytorch/torch/fx/experimental/symbolic_shapes.py", line 5122, in evaluate_expr
    return self._evaluate_expr(orig_expr, hint, fx_node, size_oblivious, forcing_spec=forcing_spec)
  File "/data/users/pianpwk/pytorch/torch/fx/experimental/symbolic_shapes.py", line 5238, in _evaluate_expr
    raise self._make_data_dependent_error(
torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode: Could not guard on data-dependent expression Eq(u0, 1) (unhinted: Eq(u0, 1)).  (Size-like symbols: none)

Potential framework code culprit (scroll up for full backtrace):
  File "/data/users/pianpwk/pytorch/torch/_export/non_strict_utils.py", line 520, in __torch_function__
    return func(*args, **kwargs)

For more information, run with TORCH_LOGS="dynamic"
For extended logs when we create symbols, also add TORCHDYNAMO_EXTENDED_DEBUG_CREATE_SYMBOL="u0"
If you suspect the guard was triggered from C++, add TORCHDYNAMO_EXTENDED_DEBUG_CPP=1
For more debugging help, see https://docs.google.com/document/d/1HSuTTVvYH1pTew89Rtpeu84Ht3nQEFTYhAX3Ypa_xJs/edit?usp=sharing

For C++ stack trace, run with TORCHDYNAMO_EXTENDED_DEBUG_CPP=1

The following call raised this error:
  File "/data/users/pianpwk/pytorch/test/export/test_export.py", line 1198, in forward
    return bool(x.eq(0.1).any())


To execute this test, run the following from the base repo dir:
    python test/export/test_export.py TestExport.test_crash_real_tensor_eq

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0

----------------------------------------------------------------------
Ran 1 test in 1.237s

FAILED (errors=1)
```

### Versions

same as https://github.com/pytorch/pytorch/issues/135618

cc @ezyang @chauhang @penguinwu @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4