class_docstr: Functor for translating Relay programs into Python ASTs.
class_docstr_tok: ["Functor","for","translating","Relay","programs","into","Python","ASTs","."]
docstr: let var = value in body
  =======================
  def let_thunk(var):
      return body
  let_thunk(value)
docstr_tok: ["let","var","=","value","in","body","=======================","def","let_thunk","(","var",")",":","return","body","let_thunk","(","value",")"]
code: def visit_let(self, letexp: Expr):
      # To properly account for scoping and ensure that the entire node produces an expression,
      # we translate the let binding as a function that we call with the value we intend to bind.
      # Yes, this is somewhat ugly.
      """
      let var = value in body
      =======================
      def let_thunk(var):
          return body
      let_thunk(value)
      """
      bind_body, bind_defs = self.visit(letexp.body)
  
      func_name = self.generate_function_name("_let_func")
      binding_func = self.create_def(
          func_name,
          [self.get_var_name(letexp.var)],
          bind_defs + [Return(bind_body)],
      )
  
      # we call the binding func with the intended value for the bound variable
  
      # special case: if the value is a function literal, we must ensure it can be
      # recursive by naming it after the var
      if isinstance(letexp.value, Function):
          value_def, value_name = self.convert_func_node(
              letexp.value, letexp.var
          )
          return (
              self.create_call(func_name, [Name(value_name, Load())]),
              [value_def, binding_func],
          )
  
      value_body, value_defs = self.visit(letexp.value)
      value_defs.append(binding_func)
      binding_call = self.create_call(func_name, [value_body])
      return (binding_call, value_defs)
  
imports: import sys
  import ast
  from ast import alias, Assign, Load, Name, NameConstant, Num, Return, Store, Str
  import re
  import tvm
  from tvm import relay
  from tvm.relay.adt import Pattern
  from tvm.relay.backend import te_compiler
  from tvm.relay.expr import Expr, GlobalVar, Var
  from tvm.relay.function import Function
  from tvm.relay.expr_functor import ExprFunctor
label_desc: Use image node_id 23 for calling the PythonConverter obj's underlying member method code with example usage: obj.visit_let(letexp) and returns: binding_call,  value_defs, self,  list