class_docstr: CFG visitor that performs liveness analysis at statement level.
class_docstr_tok: ["CFG","visitor","that","performs","liveness","analysis","at","statement","level","."]
code: def visit_node(self, node):
      prev_live_in = self.in_[node]
  
      if anno.hasanno(node.ast_node, anno.Static.SCOPE):
          node_scope = anno.getanno(node.ast_node, anno.Static.SCOPE)
  
          gen = node_scope.read
          if not self.include_annotations:
              gen -= node_scope.annotations
          # TODO(mdan): verify whether composites' parents need to be added.
          # E.g. whether x needs to be added if x.y is live. Theoretically the
          # activity analysis should have both so that wouldn't be needed.
          kill = node_scope.modified | node_scope.deleted
  
          live_out = set()
          for n in node.next:
              live_out |= self.in_[n]
          live_in = gen | (live_out - kill)
  
          reaching_functions = anno.getanno(
              node.ast_node, anno.Static.DEFINED_FNS_IN
          )
          for fn_ast_node in reaching_functions:
              if isinstance(fn_ast_node, gast.Lambda):
                  # Exception: lambda functions are assumed to be used only in the
                  # place where they are defined, and not later.
                  continue
              fn_scope = anno.getanno(
                  fn_ast_node, annos.NodeAnno.ARGS_AND_BODY_SCOPE
              )
              # Any closure of a reaching function definition is conservatively
              # considered live.
              live_in |= fn_scope.read - fn_scope.bound
  
      else:
          assert self.can_ignore(node), (node.ast_node, node)
  
          live_out = set()
          for n in node.next:
              live_out |= self.in_[n]
          live_in = live_out
  
      self.in_[node] = live_in
      self.out[node] = live_out
  
      # TODO(mdan): Move this to the superclass?
      return prev_live_in != live_in
  
imports: import gast
  from nvidia.dali._autograph.pyct import anno
  from nvidia.dali._autograph.pyct import cfg
  from nvidia.dali._autograph.pyct import transformer
  from nvidia.dali._autograph.pyct.static_analysis import annos
label_desc: Use image node_id 3 for calling the Analyzer obj's underlying member method code with example usage: obj.visit_node(node) and returns: unknown