Implement symbolic for slice operation (#5204)
diff --git a/torch/onnx/symbolic.py b/torch/onnx/symbolic.py
index 8f6b478..68a0e0d 100644
--- a/torch/onnx/symbolic.py
+++ b/torch/onnx/symbolic.py
@@ -534,6 +534,12 @@
return g.op("ATen", input, weight, bias, operator_s="conv_tbc", pad_i=pad)
+def slice(g, self, dim, start, end, step):
+ if step != 1:
+ _unimplemented("slice", "step!=1 is currently not supported")
+ return g.op("Slice", self, axes_i=[dim], starts_i=[start], ends_i=[end])
+
+
def instance_norm(g, input, **kwargs):
input_type = input.type().scalarType()
weight = kwargs.get("weight", None)