code: def handle_return_unused_inputs(prog):
      """
      prog: Program
  
      # NN cannot handle returning input as output. Insert an identity op for
      # those cases. Example:
      #
      # Given:
      #    main(%a: (1, 2, fp32),
      #         %b: (1, 2, fp32)) {
      #      block0() {
      #        %mul_0_y_0: (i32)* = const(val=2)
      #        %mul_0: (1, 2, fp64) = mul(x=%a, y=%mul_0_y_0)
      #      } -> (%mul_0, %b)
      #    }
      #
      # (Notice that %b is returned from input. This causes error in NN)
      #
      # Result:
      #    main(%a: (1, 2, fp32),
      #         %b: (1, 2, fp32)) {
      #      block0() {
      #        %mul_0_y_0: (i32)* = const(val=2)
      #        %mul_0: (1, 2, fp64) = mul(x=%a, y=%mul_0_y_0)
      #        %b_tmp: (1, 2, fp32) = identity(x=%b)
      #        %b: (1, 2, fp32) = identity(x=%b_tmp)
      #      } -> (%mul_0, %b)
      #    }
      #
      # where identity is applied twice since NN layer cannot have
      # input name == output name
      """
      for f_name, f in prog.functions.items():
          handle_return_unused_inputs_func(f)
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 2 for calling a global function with example usage: handle_return_unused_inputs(prog) without return types