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
856
+
@register_canonicalize
857
+
@register_stabilize
858
+
@node_rewriter([det])
859
+
defrewrite_det_kronecker(fgraph, node):
860
+
"""
861
+
This rewrite simplifies the determinant of a kronecker-structured matrix by extracting the individual sub matrices and returning the det values computed using those
862
862
863
-
# Parameters
864
-
# ----------
865
-
# fgraph: FunctionGraph
866
-
# Function graph being optimized
867
-
# node: Apply
868
-
# Node of the function graph to be optimized
863
+
Parameters
864
+
----------
865
+
fgraph: FunctionGraph
866
+
Function graph being optimized
867
+
node: Apply
868
+
Node of the function graph to be optimized
869
869
870
-
# Returns
871
-
# -------
872
-
# list of Variable, optional
873
-
# List of optimized variables, or None if no optimization was performed
874
-
# """
875
-
# # Check for inner kron operation
876
-
# potential_kron = node.inputs[0].owner
877
-
# if not (potential_kron and isinstance(potential_kron.op, KroneckerProduct)):
878
-
# return None
870
+
Returns
871
+
-------
872
+
list of Variable, optional
873
+
List of optimized variables, or None if no optimization was performed
0 commit comments