Skip to content

Commit b2b6c6d

Browse files
committed
Remove duplicated Inv Op
1 parent e58bd91 commit b2b6c6d

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

pytensor/tensor/nlinalg.py

+1-19
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,6 @@ def pinv(x, hermitian=False):
7878
return MatrixPinv(hermitian=hermitian)(x)
7979

8080

81-
class Inv(Op):
82-
"""Computes the inverse of one or more matrices."""
83-
84-
def make_node(self, x):
85-
x = as_tensor_variable(x)
86-
return Apply(self, [x], [x.type()])
87-
88-
def perform(self, node, inputs, outputs):
89-
(x,) = inputs
90-
(z,) = outputs
91-
z[0] = np.linalg.inv(x).astype(x.dtype)
92-
93-
def infer_shape(self, fgraph, node, shapes):
94-
return shapes
95-
96-
97-
inv = Inv()
98-
99-
10081
class MatrixInverse(Op):
10182
r"""Computes the inverse of a matrix :math:`A`.
10283
@@ -170,6 +151,7 @@ def infer_shape(self, fgraph, node, shapes):
170151

171152

172153
matrix_inverse = MatrixInverse()
154+
inv = matrix_inverse
173155

174156

175157
def matrix_dot(*args):

0 commit comments

Comments
 (0)