code: def test_gpu_cholesky_not_inplace():
      if not cusolver_available or not slinalg.imported_scipy:
          raise SkipTest("No cuSolver or SciPy")
      A = tensor.fmatrix()
      A_squared = A**2
      B = slinalg.cholesky(A_squared)
      D = B + A_squared
      f_cpu = theano.function([A], D, mode=mode_without_gpu)
      f_gpu = theano.function([A], D, mode=mode_with_gpu)
      # GpuCholesky op in this graph should NOT be inplace (as his input is reused in another op)
      count_cholesky_not_inplace = len(
          [
              n.op
              for n in f_gpu.maker.fgraph.apply_nodes
              if isinstance(n.op, GpuCholesky) and not n.op.inplace
          ]
      )
      assert count_cholesky_not_inplace == 1, count_cholesky_not_inplace
      M_val = np.random.normal(size=(3, 3)).astype("float32")
      # A = M.dot(M) will be positive definite for all non-singular M
      A_val = M_val.dot(M_val.T)
      utt.assert_allclose(f_cpu(A_val), f_gpu(A_val))
  
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 25 for calling a global function with example usage: test_gpu_cholesky_not_inplace() without return types