code: def test_local_gpu_elemwise_careduce():
      mode_with_gpu_no_cudnn = mode_with_gpu.excluding("cudnn")
      x = theano.tensor.matrix()
  
      def fn_sum_square(x, axis):
          return (x * x).sum(axis=axis)
  
      def fn_sum_abs(x, axis):
          return abs(x).sum(axis=axis)
  
      def fn_max_abs(x, axis):
          return abs(x).max(axis=axis)
  
      for fn, pre_scalar_op in (
          (fn_sum_square, theano.scalar.sqr),
          (fn_sum_abs, theano.scalar.abs_),
          (fn_max_abs, theano.scalar.abs_),
      ):
          for axis in (None, 0, 1):
              o = fn(x, axis)
              f = theano.function([x], o, mode=mode_with_gpu_no_cudnn)
              topo = f.maker.fgraph.toposort()
              assert len(topo) == 3
              assert isinstance(topo[1].op, GpuCAReduceCuda)
              assert topo[1].op.pre_scalar_op == pre_scalar_op
              assert _check_stack_trace(f)
              data = np.random.rand(3, 4).astype(theano.config.floatX)
              utt.assert_allclose(fn(data, axis), f(data))
  
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 13 for calling a global function with example usage: test_local_gpu_elemwise_careduce() and returns: unknown, abs, abs