code: def test_setType_maintains_output_shape_for_single_custom_op_with_dynamic_axes(
      self,
  ):
      self.addCleanup(
          torch.onnx.unregister_custom_op_symbolic, "::linalg_inv", 9
      )
  
      class CustomInverse(torch.nn.Module):
          def forward(self, x):
              return torch.inverse(x) + x
  
      def linalg_inv_settype(g, self):
          return g.op("com.microsoft::Inverse", self).setType(
              self.type()
              .with_dtype(torch.float)
              .with_sizes([None, 3, 3])
          )
  
      torch.onnx.register_custom_op_symbolic(
          "::linalg_inv", linalg_inv_settype, 9
      )
      model = CustomInverse()
      x = torch.randn(2, 3, 3)
      f = io.BytesIO()
      torch.onnx.export(
          model,
          (x,),
          f,
          opset_version=self.opset_version,
          custom_opsets={"com.microsoft": 1},
          input_names=["x"],
          dynamic_axes={"x": {0: "batch"}},
      )
  
      model_proto = onnx.load(io.BytesIO(f.getvalue()))
      model_value_info = model_proto.graph.value_info
      self.assertIsNotNone(model_value_info)
      assert model_value_info
      dims = model_value_info[0].type.tensor_type.shape.dim
      # The first axe should be dynamic as we defined when exporting
      self.assertTrue(dims[0].HasField("dim_param"))
      for i in range(1, len(dims)):
          # If node output has shape info, it should have dim_value
          # Otherwise, it has dim_params with dynamic shape
          self.assertTrue(dims[i].HasField("dim_value"))
          self.assertEqual(dims[i].dim_value, x.size()[i])
  
imports: import io
  import numpy
  import onnx
  import pytorch_test_common
  import torch
  from pytorch_test_common import skipIfUnsupportedMinOpsetVersion
  from torch.onnx import _constants, utils
  from torch.onnx._globals import GLOBALS
  from torch.onnx._internal import jit_utils
  from torch.testing._internal import common_utils
label_desc: Use image node_id 4 for calling the TestONNXCustomOpShapeInference obj's underlying member method code with example usage: obj.test_setType_maintains_output_shape_for_single_custom_op_with_dynamic_axes() and returns: g, unknown