code: def testDotGeneral(self, precision):
      for dtype in self.float_types:
  
          def dot_fn(lhs, rhs):
              dnums = xla_data_pb2.DotDimensionNumbers()
              dnums.lhs_contracting_dimensions.append(2)
              dnums.rhs_contracting_dimensions.append(1)
              dnums.lhs_batch_dimensions.append(0)
              dnums.rhs_batch_dimensions.append(0)
              precision_config = None
              if precision:
                  precision_config = xla_data_pb2.PrecisionConfig()
                  precision_config.operand_precision.extend(
                      [precision, precision]
                  )
              return xla.dot_general(
                  lhs,
                  rhs,
                  dimension_numbers=dnums,
                  precision_config=precision_config,
              )
  
          lhs = np.array(
              [
                  [[1, 2], [3, 4]],
                  [[5, 6], [7, 8]],
              ],
              dtype=dtype,
          )
          rhs = np.array(
              [
                  [[1, 2, 3], [4, 5, 6]],
                  [[7, 8, 9], [10, 11, 12]],
              ],
              dtype=dtype,
          )
          self._assertOpOutputMatchesExpected(
              dot_fn,
              args=(lhs, rhs),
              expected=np.array(
                  [
                      [[9, 12, 15], [19, 26, 33]],
                      [[95, 106, 117], [129, 144, 159]],
                  ],
                  dtype=dtype,
              ),
          )
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.compiler.tf2xla.ops import gen_xla_ops
  from tensorflow.compiler.tf2xla.python import xla
  from local_xla.xla import xla_data_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.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import random_ops_util
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 9 for calling the XlaOpsNumericalTest obj's underlying member method code with example usage: obj.testDotGeneral(precision) and returns: xla