code: def test_dynamic_output_shapes(backend):
      example_input = torch.rand(2, 3)
      traced_model = torch.jit.trace(
          TestSimpleModule().eval(), example_input
      )
  
      input_shape = ct.Shape(shape=(2, ct.RangeDim(3, 5)))
      model = ct.convert(
          traced_model,
          inputs=[ct.TensorType(shape=input_shape)],
          convert_to=backend[0],
      )
  
      spec = model.get_spec()
      # We don't put the shape information for dynamic output shapes,
      # otherwise a runtime validation error would raise
      assert spec.description.output[0].type.multiArrayType.shape == []
      assert spec.description.output[1].type.multiArrayType.shape == []
      # scalar outputs have shape ()
      assert spec.description.output[2].type.multiArrayType.shape == []
  
      coreml_in = {"x_1": _np.random.rand(2, 3)}
      model.predict(coreml_in)
  
imports: import itertools
  import os
  import tempfile
  import numpy
  import PIL.Image
  import pytest
  import coremltools
  from coremltools._deps import _HAS_TF_2, _HAS_TORCH, MSG_TF2_NOT_FOUND, MSG_TORCH_NOT_FOUND
  from coremltools.converters.mil import Builder
  from coremltools.converters.mil.testing_reqs import backends, compute_units
label_desc: Use image node_id 2 for calling the TestOutputShapes obj's underlying member method code with example usage: obj.test_dynamic_output_shapes(backend) without return types