Skip to content

Commit

Permalink
Implement symbolic for slice operation (#5204)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Reed authored and ezyang committed Feb 13, 2018
1 parent ab18aae commit f96f3c3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions torch/onnx/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,12 @@ def conv_tbc(g, input, weight, bias, pad):
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)
Expand Down

0 comments on commit f96f3c3

Please sign in to comment.