docstr: Input graph:
  
  func main(float64 a, float32 b) {
      float64 out_0, float32 out_1 = while_loop(a, b,
          (float64 a, float32 b) {
              bool cond = less(a, b)
          } -> (cond)
          (float64 a, float32 b) {
              float64 temp = const(1)
              float64 out = add(a, b)
          } -> (out, b)
      );
  } -> (out_0, out_1)
  
  becomes
  
  func main(float32 a, float32 b) {
      float32 out_0, float32 out_1 = while_loop(a, b,
          (float32 a, float32 b) {
              bool cond = less(a, b)
          } -> (cond)
          (float32 a, float32 b) {
              float32 temp = const(1)
              float32 out = add(a, b)
          } -> (out, b)
      );
  } -> (out_0, out_1)
docstr_tok: ["Input","graph",":","func","main","(","float64","a",",","float32","b",")","{","float64","out_0",",","float32","out_1","=","while_loop","(","a",",","b",",","(","float64","a",",","float32","b",")","{","bool","cond","=","less","(","a",",","b",")","}","-",">","(","cond",")","(","float64","a",",","float32","b",")","{","float64","temp","=","const","(","1",")","float64","out","=","add","(","a",",","b",")","}","-",">","(","out",",","b",")",")",";","}","-",">","(","out_0",",","out_1",")","becomes","func","main","(","float32","a",",","float32","b",")","{","float32","out_0",",","float32","out_1","=","while_loop","(","a",",","b",",","(","float32","a",",","float32","b",")","{","bool","cond","=","less","(","a",",","b",")","}","-",">","(","cond",")","(","float32","a",",","float32","b",")","{","float32","temp","=","const","(","1",")","float32","out","=","add","(","a",",","b",")","}","-",">","(","out",",","b",")",")",";","}","-",">","(","out_0",",","out_1",")"]
code: def test_subblock(self):
      """
      Input graph:
  
      func main(float64 a, float32 b) {
          float64 out_0, float32 out_1 = while_loop(a, b,
              (float64 a, float32 b) {
                  bool cond = less(a, b)
              } -> (cond)
              (float64 a, float32 b) {
                  float64 temp = const(1)
                  float64 out = add(a, b)
              } -> (out, b)
          );
      } -> (out_0, out_1)
  
      becomes
  
      func main(float32 a, float32 b) {
          float32 out_0, float32 out_1 = while_loop(a, b,
              (float32 a, float32 b) {
                  bool cond = less(a, b)
              } -> (cond)
              (float32 a, float32 b) {
                  float32 temp = const(1)
                  float32 out = add(a, b)
              } -> (out, b)
          );
      } -> (out_0, out_1)
      """
      pytest.xfail("fp64 dtype not supported in MIL")
  
      def body(a, b):
          return mb.add(x=a, y=np.float64(1)), b
  
      def cond(a, b):
          return mb.less(x=a, y=b)
  
      @mb.program(
          input_specs=[
              mb.TensorSpec(shape=(1,), dtype=types.fp64),
              mb.TensorSpec(shape=(1,), dtype=types.fp32),
          ]
      )
      def prog(a, b):
          return mb.while_loop(_cond=cond, _body=body, loop_vars=(a, b))
  
      prev_prog, prev_block, block = apply_pass_and_basic_check(
          prog, "mil_backend::adjust_io_to_supported_types"
      )
  
      prev_inputs = list(prev_prog.functions["main"].inputs.items())
      inputs = list(prog.functions["main"].inputs.items())
      for i in range(0, len(prev_inputs)):
          assert prev_inputs[i][1].name == inputs[i][1].name
          assert inputs[i][1].dtype == types.fp32
  
      assert get_op_types_in_program(prev_prog) == ["while_loop"]
      assert get_op_types_in_program(prog) == ["while_loop"]
  
      def assert_block_inputs(prev_inputs, inputs):
          for i in range(0, len(prev_inputs)):
              assert prev_inputs[i].name == inputs[i].name
              assert inputs[i].dtype == types.fp32
  
      subblocks = prog.functions["main"].operations[0].blocks
      prev_subblocks = prev_prog.functions["main"].operations[0].blocks
      for i in range(0, len(subblocks)):
          assert_block_inputs(
              prev_subblocks[i].inputs, subblocks[i].inputs
          )
  
imports: import copy
  import itertools
  import numpy
  import pytest
  import coremltools
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.passes.pass_registry import PASS_REGISTRY
  from coremltools.converters.mil.testing_utils import apply_pass_and_basic_check, assert_model_is_valid, get_op_types_in_program
label_desc: Use image node_id 8 for calling the TestAdjustToSupportedTypes obj's underlying member method code with example usage: obj.test_subblock() and returns: mb,  b, mb, mb