Skip to content

Commit b4b194d

Browse files
vvchernovValery Chernov
andauthored
extend repeat_interleave op for relay.Expr (#8839)
Co-authored-by: Valery Chernov <[email protected]>
1 parent 227bf7f commit b4b194d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

python/tvm/relay/frontend/pytorch.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,12 @@ def repeat_interleave(self, inputs, input_types):
573573
if isinstance(inputs[1], int):
574574
repeats = inputs[1]
575575
axis = inputs[2]
576+
elif isinstance(inputs[1], _expr.Expr):
577+
if isinstance(inputs[1], _expr.Constant):
578+
repeats = int(inputs[1].data.numpy())
579+
else:
580+
repeats, _ = try_infer_value(inputs[1], lambda ret: ret.tolist())
581+
axis = inputs[2]
576582
else:
577583
msg = "Only repeat with one value as repeat is currently supported."
578584
raise AssertionError(msg)

0 commit comments

Comments
 (0)