Skip to content

Commit bc75e85

Browse files
committed
Use inputTensorToAttr in squeeze canonicalization
1 parent f180f85 commit bc75e85

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

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, tensorIdx = 1, attr = "axes")
516512

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

0 commit comments

Comments
 (0)