You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#This rewrite simplifies the slogdet of a kronecker-structured matrix by extracting the individual sub matrices and returning the sign and logdet values computed using those
860
+
@register_canonicalize
861
+
@register_stabilize
862
+
@node_rewriter([det])
863
+
defrewrite_det_kronecker(fgraph, node):
864
+
"""
865
+
This rewrite simplifies the determinant of a kronecker-structured matrix by extracting the individual sub matrices and returning the det values computed using those
866
866
867
-
# Parameters
868
-
# ----------
869
-
# fgraph: FunctionGraph
870
-
# Function graph being optimized
871
-
# node: Apply
872
-
# Node of the function graph to be optimized
867
+
Parameters
868
+
----------
869
+
fgraph: FunctionGraph
870
+
Function graph being optimized
871
+
node: Apply
872
+
Node of the function graph to be optimized
873
873
874
-
# Returns
875
-
# -------
876
-
# list of Variable, optional
877
-
# List of optimized variables, or None if no optimization was performed
878
-
# """
879
-
# # Check for inner kron operation
880
-
# potential_kron = node.inputs[0].owner
881
-
# if not (potential_kron and isinstance(potential_kron.op, KroneckerProduct)):
882
-
# return None
874
+
Returns
875
+
-------
876
+
list of Variable, optional
877
+
List of optimized variables, or None if no optimization was performed
0 commit comments