class_docstr: prog: Program
  
  # NN backend expects output vars as loop vars. Example:
  #
  # Given:
  #    main(%a: (1, 2, fp32),
  #         %b: (1, 2, fp32)) {
  #      block0() {
  #        %loop:0: (1, 2, fp32), %loop:1: (1, 2, fp32) =     #        while_loop(loop_vars=(%a, %b))
  #          loop_cond(%a.x, %b.x) {
  #            %cond_var: (bool) = some_op(x=%a.x, y=%b.x)
  #          } -> (%cond_var)
  #          loop_body(%a.x, %b.x) {
  #            %add_0: (1, 2, fp32) = add(x=%a.x, y=%b.x)
  #          } -> (%add_0, %b.x)
  #      } -> (%loop:0, %loop:1)
  #    }
  #
  # Result:
  #    main(%a: (1, 2, fp32),
  #         %b: (1, 2, fp32)) {
  #      block0() {
  #        %loop:0: (1, 2, fp32), %loop:1: (1, 2, fp32) =     #        while_loop(loop_vars=(%a, %b))
  #          loop_cond(%loop:0, %loop:1) {
  #            %cond_var: (bool) = some_op(x=%loop:0, y=%loop:1)
  #          } -> (%cond_var)
  #          loop_body(%loop:0, %loop:1) {
  #            %add_0: (1, 2, fp32) = add(x=%loop:0, y=%loop:1)
  #          } -> (%add_0, %loop:1)
  #      } -> (%loop:0, %loop:1)
  #    }
  #
  # Comment: The resulting program is no longer SSA (multiple assignments on
  # %loop:0).
class_docstr_tok: ["prog",":","Program","#","NN","backend","expects","output","vars","as","loop","vars",".","Example",":","#","#","Given",":","#","main","(","%","a",":","(","1",",","2",",","fp32",")",",","#","%","b",":","(","1",",","2",",","fp32",")",")","{","#","block0","(",")","{","#","%","loop:0",":","(","1",",","2",",","fp32",")",",","%","loop:1",":","(","1",",","2",",","fp32",")","=","#","while_loop","(","loop_vars=","(","%","a",",","%","b",")",")","#","loop_cond","(","%","a.x",",","%","b.x",")","{","#","%","cond_var",":","(","bool",")","=","some_op","(","x=","%","a.x",",","y=","%","b.x",")","#","}","-",">","(","%","cond_var",")","#","loop_body","(","%","a.x",",","%","b.x",")","{","#","%","add_0",":","(","1",",","2",",","fp32",")","=","add","(","x=","%","a.x",",","y=","%","b.x",")","#","}","-",">","(","%","add_0",",","%","b.x",")","#","}","-",">","(","%","loop:0",",","%","loop:1",")","#","}","#","#","Result",":","#","main","(","%","a",":","(","1",",","2",",","fp32",")",",","#","%","b",":","(","1",",","2",",","fp32",")",")","{","#","block0","(",")","{","#","%","loop:0",":","(","1",",","2",",","fp32",")",",","%","loop:1",":","(","1",",","2",",","fp32",")","=","#","while_loop","(","loop_vars=","(","%","a",",","%","b",")",")","#","loop_cond","(","%","loop:0",",","%","loop:1",")","{","#","%","cond_var",":","(","bool",")","=","some_op","(","x=","%","loop:0",",","y=","%","loop:1",")","#","}","-",">","(","%","cond_var",")","#","loop_body","(","%","loop:0",",","%","loop:1",")","{","#","%","add_0",":","(","1",",","2",",","fp32",")","=","add","(","x=","%","loop:0",",","y=","%","loop:1",")","#","}","-",">","(","%","add_0",",","%","loop:1",")","#","}","-",">","(","%","loop:0",",","%","loop:1",")","#","}","#","#","Comment",":","The","resulting","program","is","no","longer","SSA","(","multiple","assignments","on","#","%","loop:0",")","."]
code: def apply(self, prog):
      for f in prog.functions.values():
          _commingle_loop_vars_block(f)
  
imports: from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 1 for calling the commingle_loop_vars obj's underlying member method code with example usage: obj.apply(prog) without return types