parameters: (self, node)
return_statement: return ast.copy_location(expr_wrapper, node)
docstring: Swap out the Assert node (Python's `assert`) with a callsite to the
          symbolically-traceable torch._assert function
docstring_summary: Swap out the Assert node (Python's `assert`) with a callsite to the
          symbolically-traceable torch._assert function
docstring_tokens: Swap out the Assert node ( Python s assert ) with a callsite to the symbolically - traceable torch . _assert function
function: def visit_Assert(self, node):
          """
          Swap out the Assert node (Python's `assert`) with a callsite to the
          symbolically-traceable torch._assert function
          """
          # Create the Call node
          n = ast.parse('torch._assert()', mode='eval')
          assert isinstance(n, ast.Expression)
          call_node = n.body
          assert isinstance(call_node, ast.Call)
          msg = node.msg if node.msg else ast.Constant(value="", kind=None)
          call_node.args = [node.test, msg]
  
          # Ensure that the new node conforms to the Python AST grammar
          expr_wrapper = ast.Expr(value=call_node)
  
          # Return the new Call node to signify that we want to use it as
          # a replacement for the original _assert node
          return ast.copy_location(expr_wrapper, node)
function_tokens: def visit_Assert ( self , node ) : # Create the Call node n = ast . parse ( 'torch._assert()' , mode = 'eval' ) assert isinstance ( n , ast . Expression ) call_node = n . body assert isinstance ( call_node , ast . Call ) msg = node . msg if node . msg else ast . Constant ( value = "" , kind = None ) call_node . args = [ node . test , msg ] # Ensure that the new node conforms to the Python AST grammar expr_wrapper = ast . Expr ( value = call_node ) # Return the new Call node to signify that we want to use it as # a replacement for the original _assert node return ast . copy_location ( expr_wrapper , node )