class_docstr: Take a FunctionType object representing a `forward` method, then
  perform an AST rewrite to swap out nodes that are not symbolically
  traceable with a callsite to the FX alternative.
  
  To support swapping out an AST node, define a new `visit` method on
  that node. For more details, see:
  https://docs.python.org/3/library/ast.html#ast.NodeTransformer
class_docstr_tok: ["Take","a","FunctionType","object","representing","a","`","forward","`","method",",","then","perform","an","AST","rewrite","to","swap","out","nodes","that","are","not","symbolically","traceable","with","a","callsite","to","the","FX","alternative",".","To","support","swapping","out","an","AST","node",",","define","a","new","`","visit","`","method","on","that","node",".","For","more","details",",","see",":","https",":","\/\/docs.python.org\/3\/library\/ast.html","#","ast.NodeTransformer"]
docstr: Swap out Python's AnnAssign with an Assign node where the annotation function is called.
  Example:
       Original:
       y: Tensor_Type(1,2,3, Dyn) = f2(x)
      Output:
       y = annotate(f2(x),Tensor_Type((1,2,3,Dyn)))
docstr_tok: ["Swap","out","Python","'s","AnnAssign","with","an","Assign","node","where","the","annotation","function","is","called",".","Example",":","Original",":","y",":","Tensor_Type","(","1,2,3",",","Dyn",")","=","f2","(","x",")","Output",":","y","=","annotate","(","f2","(","x",")",",","Tensor_Type","(","(","1,2,3",",","Dyn",")",")",")"]
code: def visit_AnnAssign(self, node):
      """
      Swap out Python's AnnAssign with an Assign node where the annotation function is called.
      Example:
           Original:
           y: Tensor_Type(1,2,3, Dyn) = f2(x)
          Output:
           y = annotate(f2(x),Tensor_Type((1,2,3,Dyn)))
      """
      return ast.Assign(
          targets=[node.target],
          value=ast.Call(
              func=ast.Name(id="annotate", ctx=ast.Load()),
              args=[node.value, node.annotation],
              keywords=[],
          ),
      )
  
file_path: pytorch/torch/fx/experimental/rewriter.py
imports: import ast
  import inspect
  import textwrap
  import copy
  import functools
  from types import FunctionType
  from typing import cast, Union, Callable, Dict, Optional, Any
  from torch.fx._symbolic_trace import Tracer
  from torch.fx.graph import Graph
  from torch._sources import normalize_source_lines
  import torch
label_desc: Use image node_id 3 for calling the AST_Rewriter obj's underlying member method code with example usage: obj.visit_AnnAssign(node) and returns: ast