docstr: Called when a proxy object is being converted to a boolean, such as
  when used in control flow.  Normally we don't know what to do because
  we don't know the value of the proxy, but a custom tracer can attach more
  information to the graph node using create_node and can choose to return a value.
docstr_tok: ["Called","when","a","proxy","object","is","being","converted","to","a","boolean",",","such","as","when","used","in","control","flow",".","Normally","we","do","n't","know","what","to","do","because","we","do","n't","know","the","value","of","the","proxy",",","but","a","custom","tracer","can","attach","more","information","to","the","graph","node","using","create_node","and","can","choose","to","return","a","value","."]
code: def to_bool(self, obj: "Proxy") -> bool:
      """Called when a proxy object is being converted to a boolean, such as
      when used in control flow.  Normally we don't know what to do because
      we don't know the value of the proxy, but a custom tracer can attach more
      information to the graph node using create_node and can choose to return a value.
      """
      raise TraceError(
          "symbolically traced variables cannot be used as inputs to control flow"
      )
  
imports: import enum
  import dis
  import copy
  import sys
  import torch
  import inspect
  import operator
  import traceback
  import collections
  from dataclasses import is_dataclass, fields
  from .graph import magic_methods, reflectable_magic_methods, Graph
  from typing import Tuple, Dict, OrderedDict, Optional, Any, Iterator, Callable
  from .node import Target, Node, Argument, base_types, map_aggregate
  from ._compatibility import compatibility
  from .operator_schemas import check_for_mutable_operation
  import torch.fx.traceback
label_desc: Use image node_id 6 for calling the TracerBase obj's underlying member method code with example usage: obj.to_bool(obj) without return types