class_docstr: Test the basic builder API.
class_docstr_tok: ["Test","the","basic","builder","API","."]
docstr: ``add_function`` should error out when a function with different
  opset is added to a program.
docstr_tok: ["``","add_function","``","should","error","out","when","a","function","with","different","opset","is","added","to","a","program","."]
code: def test_error_out_incompatible_functions(self):
      """
      ``add_function`` should error out when a function with different
      opset is added to a program.
      """
  
      @mb.function(
          input_specs=[mb.TensorSpec(shape=(2, 4))],
          opset_version=ct.target.iOS13,
      )
      def func_1(x):
          return x
  
      @mb.function(
          input_specs=[mb.TensorSpec(shape=(2, 4))],
          opset_version=ct.target.iOS17,
      )
      def func_2(x):
          return x
  
      err_msg = "all functions must have the same opset_version."
  
      prog = Program()
      prog.add_function("func_1", func_1)
      with pytest.raises(ValueError, match=err_msg):
          prog.add_function("func_2", func_2)
  
      prog = Program()
      prog.add_function("func_2", func_2)
      with pytest.raises(ValueError, match=err_msg):
          prog.add_function("func_1", func_1)
  
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 5 for calling the TestMILBuilderAPI obj's underlying member method code with example usage: obj.test_error_out_incompatible_functions() and returns: x, x