Skip to content

Commit

Permalink
Handle empty string when using getenv (pytorch#137159)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasmatyassy committed Oct 31, 2024
1 parent c3bff46 commit e34366d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions torch/fx/experimental/symbolic_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4281,15 +4281,15 @@ def create_symbol(
sympy_expr
) in config.extended_debug_create_symbol.split(",")
maybe_more_info = ""
if (
not is_debug
and os.getenv("TORCHDYNAMO_EXTENDED_ADVICE=0") is not None
if not is_debug and os.getenv("TORCHDYNAMO_EXTENDED_ADVICE", "1") not in (
"0",
"",
):
maybe_more_info = (
", for more info run with "
f'TORCHDYNAMO_EXTENDED_DEBUG_CREATE_SYMBOL="{sympy_expr}" '
"or suppress this message by setting the environment "
'variable "TORCHDYNAMO_EXTENDED_ADVICE=0"'
"or to suppress this message run with "
'TORCHDYNAMO_EXTENDED_ADVICE="0"'
)
sloc, maybe_extra_debug = self._get_stack_summary(is_debug)
self.log.info(
Expand Down

0 comments on commit e34366d

Please sign in to comment.