class_docstr: Test basic functionality of opset version handling in pymil
class_docstr_tok: ["Test","basic","functionality","of","opset","version","handling","in","pymil"]
docstr: The program consist of pixel_unshuffle should be inferred as an iOS16 version program
docstr_tok: ["The","program","consist","of","pixel_unshuffle","should","be","inferred","as","an","iOS16","version","program"]
code: def test_pymil_opset_version_inference():
      """
      The program consist of pixel_unshuffle should be inferred as an iOS16 version program
      """
      prog = get_simple_pixel_unshuffle_program()
      assert prog.functions["main"].opset_version == ct.target.iOS16
  
      expected_err_str = (
          "Please update the minimum_deployment_target to coremltools.target.iOS16, "
          "since op pixel_unshuffle is only available in opset coremltools.target.iOS16 or newer."
      )
      with pytest.raises(ValueError, match=expected_err_str):
          mlmodel = ct.convert(
              prog,
              convert_to="mlprogram",
              compute_units=ct.ComputeUnit.CPU_ONLY,
          )
  
imports: import numpy
  import pytest
  import coremltools
  from coremltools import _logger
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, Program, types
  from coremltools.converters.mil.mil.passes.tests.test_passes import CONSTEXPR_FUNCS
label_desc: Use image node_id 4 for calling the TestMILProgramVersionHandling obj's underlying member method code with example usage: obj.test_pymil_opset_version_inference() without return types