code: def test_ios17_output_indices_dtype(
      self, compute_unit, backend, output_indices_dtype
  ):
      def build(x):
          return mb.topk(
              x=x,
              k=2,
              axis=1,
              output_indices_dtype=output_indices_dtype,
          )
  
      val = np.array([[2, 3, 1], [5, 4, 6]], dtype=np.int32)
      input_placeholders = {
          "x": mb.placeholder(shape=val.shape, dtype=types.int32)
      }
      input_values = {"x": val}
      expected_output_types = [(2, 2, types.int32), (2, 2, types.int32)]
      expected_outputs = [
          np.array([[3, 2], [6, 5]], dtype=np.int32),
          np.array([[1, 0], [2, 0]], dtype=np.int32),
      ]
  
      mlmodel = run_compare_builder(
          build,
          input_placeholders,
          input_values,
          expected_output_types,
          expected_outputs,
          compute_unit=compute_unit,
          backend=backend,
      )
      prog = mlmodel._mil_program
      topk_op = prog["main"].find_ops(op_type="topk")[0]
  
      # If output_indices_dtype is not set, the output should be in type int32
      expected_output_indices_dtype = "int32"
      if output_indices_dtype is not None:
          expected_output_indices_dtype = output_indices_dtype
  
      assert (
          types.builtin_to_string(topk_op.outputs[1].dtype)
          == expected_output_indices_dtype
      )
  
file_path: coremltools/coremltools/converters/mil/mil/ops/tests/iOS17/test_tensor_operation.py
imports: import itertools
  import numpy
  import pytest
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.ops.tests.iOS17 import backends
  from coremltools.converters.mil.mil.ops.tests.testing_utils import run_compare_builder
  from coremltools.converters.mil.testing_reqs import compute_units
label_desc: Use image node_id 2 for calling the TestTopK obj's underlying member method code with example usage: obj.test_ios17_output_indices_dtype(compute_unit, backend, output_indices_dtype) and returns: mb