code: def make_declare(loop_orders, dtypes, sub):
      """
      Produce code to declare all necessary variables.
  
      """
      decl = ""
      for i, (loop_order, dtype) in enumerate(zip(loop_orders, dtypes)):
          var = sub[
              f"lv{int(i)}"
          ]  # input name corresponding to ith loop variable
          # we declare an iteration variable
          # and an integer for the number of dimensions
          decl += f"""
          {dtype}* {var}_iter;
          """
          for j, value in enumerate(loop_order):
              if value != "x":
                  # If the dimension is not broadcasted, we declare
                  # the number of elements in that dimension,
                  # the stride in that dimension,
                  # and the jump from an iteration to the next
                  decl += f"""
                  npy_intp {var}_n{int(value)};
                  ssize_t {var}_stride{int(value)};
                  int {var}_jump{int(value)}_{int(j)};
                  """
  
              else:
                  # if the dimension is broadcasted, we only need
                  # the jump (arbitrary length and stride = 0)
                  decl += f"""
                  int {var}_jump{value}_{int(j)};
                  """
  
      return decl
  
file_path: pytensor/pytensor/tensor/elemwise_cgen.py
imports: from pytensor.configdefaults import config
label_desc: Use image node_id 1 for calling a global function with example usage: make_declare(loop_orders, dtypes, sub) and returns: decl