code: def test_batched_dot_lifter():
      # The CPU Op accepts 2D and 3D inputs, as well as mixed dtypes.
      # Make sure the lifter adds the appropriate dimshuffles and casts
      rng = np.random.RandomState(utt.fetch_seed())
  
      def randX(*args):
          return rng.rand(*args).astype(theano.config.floatX)
  
      cases = [
          (randX(3, 5, 7), randX(3, 7)),
          (randX(3, 5), randX(3, 5, 7)),
          (randX(3, 5), randX(3, 5)),
          (rng.rand(3, 5, 7).astype("float32"), randX(3, 7, 9)),
          (rng.rand(3, 5, 7).astype("float64"), randX(3, 7, 9)),
      ]
      for x_val, y_val in cases:
          x = tensor.TensorType(
              broadcastable=[s == 1 for s in x_val.shape],
              dtype=x_val.dtype,
          )("x")
          y = tensor.TensorType(
              broadcastable=[s == 1 for s in y_val.shape],
              dtype=y_val.dtype,
          )("y")
          z = tensor.batched_dot(x, y)
          f = theano.function([x, y], z, mode=mode_with_gpu)
          f(x_val, y_val)
          assert check_stack_trace(f, ops_to_check="all")
  
imports: from __future__ import absolute_import, print_function, division
  from nose.tools import assert_raises
  import numpy
  import theano
  from theano import tensor
  import theano.tensor.slinalg
  from theano.tests.breakpoint import PdbBreakpoint
  from theano.tests import unittest_tools, test_ifelse
  from theano.tensor.tests import test_basic
  from theano.gof.opt import check_stack_trace
  import theano.gpuarray
  from ..None import basic_ops
  from ..type import GpuArrayType, gpuarray_shared_constructor, get_context
  from ..basic_ops import GpuAlloc, GpuAllocEmpty, GpuReshape, GpuFromHost, HostFromGpu, host_from_gpu
  from ..blas import GpuGemm
  from ..elemwise import GpuCAReduceCuda, GpuCAReduceCPY, GpuElemwise, Elemwise, max_inputs_to_GpuElemwise
  from ..dnn import GpuDnnReduction
  from ..subtensor import GpuSubtensor
  from ..linalg import GpuCusolverSolve, cusolver_available, GpuCholesky
  from .config import mode_with_gpu, mode_without_gpu, test_ctx_name, SkipTest
  import unittest
  from theano.tensor.nnet import abstract_conv
  from theano.gpuarray import dnn, blas, opt
label_desc: Use image node_id 27 for calling a global function with example usage: test_batched_dot_lifter() and returns: rng