Skip to content

Commit 1ca2766

Browse files
committed
Use tensorToAttr in squeeze canonicalization
1 parent f180f85 commit 1ca2766

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Deeploy/OperatorDescriptor.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,7 @@ class SqueezeDescriptor(OperatorDescriptor):
508508

509509
def canonicalize(self, node: gs.Node, opset: int) -> bool:
510510
if len(node.inputs) == 2:
511-
axes = node.inputs[1]
512-
assert isinstance(axes, gs.Constant), \
513-
f"Expected axes to be a constant but received axes of type {type(axes)}"
514-
node.attrs["axes"] = axes.values
515-
axes.outputs.clear()
511+
inputTensorToAttr(node, node.inputs[1], "axes")
516512

517513
if opset >= 13 and len(node.inputs) != 2:
518514
log.warning(

0 commit comments

Comments
 (0)