code: def test_wrong_actual_args_errors(self):
      x = np.arange(6, dtype=np.float32).reshape((3, 2))
      y = np.arange(6, dtype=np.int32).reshape((2, 3))
  
      # x: f32[a, 2], return x
      module, version = serialize(
          """
  module @jit_f.0 attributes {jax.uses_shape_polymorphism = true} {
    func.func public @main(%arg0: tensor<?x2xf32>, %arg1: tensor<*xi32>) -> tensor<?x2xf32> {
      return %arg0 : tensor<?x2xf32>
    }
  }
  """
      )
  
      def f(x, y):
          return xla.call_module(
              [x, y],
              module=module,
              version=version,
              Tout=[x.dtype],
              Sout=[(None, 2)],
              platforms=[self.testing_platform()],
          )
  
      self._assertOpOutputMatchesExpected(f, (x, y), (x,))
  
      x_bad_etype = x.astype(np.int32)
      with self.assertRaisesRegex(
          errors.InvalidArgumentError,
          "Element type mismatch for argument 0 passed to XlaCallModule: "
          r"expecting tensor<\?x2xf32>, got tensor<3x2xi32>",
      ):
          self._assertOpOutputMatchesExpected(
              f, (x_bad_etype, y), (x_bad_etype,)
          )
  
      y_bad_etype = y.astype(np.float32)
      with self.assertRaisesRegex(
          errors.InvalidArgumentError,
          "Element type mismatch for argument 1 passed to XlaCallModule: "
          r"expecting tensor<\*xi32>, got tensor<2x3xf32>",
      ):
          self._assertOpOutputMatchesExpected(f, (x, y_bad_etype), (x,))
  
      x_bad_shape = np.arange(15, dtype=np.float32).reshape(5, 3)
      with self.assertRaisesRegex(
          errors.InvalidArgumentError,
          "Shape mismatch for argument 0 passed to XlaCallModule: "
          r"expecting tensor<\?x2xf32>, got tensor<5x3xf32>",
      ):
          self._assertOpOutputMatchesExpected(
              f, (x_bad_shape, y), (x_bad_shape,)
          )
  
imports: import os
  import re
  from typing import Optional, Sequence
  import unittest
  from absl.testing import parameterized
  import numpy
  from tensorflow.compiler.mlir.stablehlo import stablehlo
  from tensorflow.compiler.tests import xla_test
  from tensorflow.compiler.tf2xla.ops import gen_xla_ops
  from tensorflow.compiler.tf2xla.python import xla
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import function
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import googletest
  from tensorflow.python.platform import test
label_desc: Use image node_id 11 for calling the XlaCallModuleOpTest obj's underlying member method code with example usage: obj.test_wrong_actual_args_errors() and returns: xla