code: def local_det_chol(node):
      """
      If we have det(X) and there is already an L=cholesky(X)
      floating around, then we can use prod(diag(L)) to get the determinant.
  
      """
      if node.op == det:
          (x,) = node.inputs
          for cl, xpos in x.clients:
              if isinstance(cl.op, Cholesky):
                  L = cl.outputs[0]
                  return [tensor.prod(extract_diag(L) ** 2)]
  
imports: from __future__ import absolute_import, print_function, division
  import logging
  from six import iteritems, integer_types
  from six.moves import xrange
  from theano.gof import Op, Apply
  from theano.tensor import DimShuffle, Dot
  from theano.tensor.blas import Dot22
  from theano import tensor
  import theano.tensor
  from theano.tensor.opt import register_stabilize, register_specialize, register_canonicalize
  from theano.gof import local_optimizer
  from theano.gof.opt import Optimizer
  from theano.tensor.nlinalg import MatrixInverse, matrix_inverse, extract_diag, trace, det
  from theano.tensor.slinalg import Cholesky, cholesky, Solve, solve, imported_scipy
label_desc: Use image node_id 13 for calling a global function with example usage: local_det_chol(node) and returns: list