@register_stabilize
@register_specialize
@local_optimizer(None)
def local_det_chol(node):
 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))]

@ register_stabilize @ register_specialize @ local_optimizer ( None ) def local_det_chol ( node ) : 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 ) ) ]
if we have det(x) and there is already an l=cholesky(x) floating around .