class_docstr: Test basic functionality of opset version handling in pymil
class_docstr_tok: ["Test","basic","functionality","of","opset","version","handling","in","pymil"]
docstr: Builder should pick up the right version of op based on opset_version
docstr_tok: ["Builder","should","pick","up","the","right","version","of","op","based","on","opset_version"]
code: def test_multi_versions_op_selection():
      """
      Builder should pick up the right version of op based on opset_version
      """
      # pick up the oldest version (iOS13) topk by default
      prog = get_simple_topk_program()
      main_func = prog.functions["main"]
      topk_op = main_func.find_ops(op_type="topk")[0]
      assert topk_op.opset_version == ct.target.iOS13
  
      # pick up iOS13 version topk
      prog = get_simple_topk_program(opset_version=ct.target.iOS15)
      main_func = prog.functions["main"]
      topk_op = main_func.find_ops(op_type="topk")[0]
      assert topk_op.opset_version == ct.target.iOS13
  
      # pick up iOS16 version topk
      prog = get_simple_topk_program(opset_version=ct.target.iOS16)
      main_func = prog.functions["main"]
      topk_op = main_func.find_ops(op_type="topk")[0]
      assert topk_op.opset_version == ct.target.iOS16
  
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 1 for calling the TestMILProgramVersionHandling obj's underlying member method code with example usage: obj.test_multi_versions_op_selection() without return types