Skip to content

Commit e004a49

Browse files
committed
restore math.py
1 parent ad2db07 commit e004a49

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tf2onnx/custom_opsets/ms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def version_11(cls, ctx, node, **kwargs):
104104
ctx.insert_new_node_on_output("Transpose", node.output[0], node.name + '_transposed',
105105
None, perm=constants.NCHW_TO_NHWC)
106106

107-
@tf_op("MatrixInverse", onnx_op="Inverse")
107+
@tf_op("MatrixInverse", domain=constants.MICROSOFT_DOMAIN, onnx_op="Inverse")
108108
class Inverse:
109109
@classmethod
110110
def version_12(cls, ctx, node, **kwargs):

tf2onnx/onnx_opset/math.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,3 +558,12 @@ class Einsum:
558558
@classmethod
559559
def version_12(cls, ctx, node, **kwargs):
560560
del node.attr["N"]
561+
562+
563+
@tf_op("MatrixInverse", onnx_op="Inverse")
564+
class Inverse:
565+
@classmethod
566+
def version_12(cls, ctx, node, **kwargs):
567+
utils.make_sure(node.get_attr('adjoint').i == 0, "adjoint must be false")
568+
del node.attr["adjoint"]
569+
node.domain = constants.MICROSOFT_DOMAIN

0 commit comments

Comments
 (0)