mbrookhart commented on a change in pull request #6316:
URL: https://github.com/apache/incubator-tvm/pull/6316#discussion_r475750902
##########
File path: python/tvm/relay/op/transform.py
##########
@@ -827,13 +828,17 @@ def strided_slice(data, begin, end, strides=None,
slice_mode="end"):
ret : relay.Expr
The computed result.
"""
- strides = strides or const([1], dtype="int32")
- if isinstance(begin, (tuple, list)):
- begin = const(list(begin))
- if isinstance(end, (tuple, list)):
- end = const(list(end))
- if isinstance(strides, (tuple, list)):
- strides = const(list(strides))
+ strides = strides or [1]
+ if (isinstance(begin, Expr) or isinstance(end, Expr) or
isinstance(strides, Expr)):
+ if isinstance(begin, (tuple, list)):
+ begin = const(list(begin))
+ if isinstance(end, (tuple, list)):
+ end = const(list(end))
+ if isinstance(strides, (tuple, list)):
+ strides = const(list(strides))
+ normalized_begin = _make.where(begin < cast_like(const(0), begin),
Review comment:
Hmm, yeah, seems a little odd to produce a subgraph as part of the
constructor of an op, which is why I put it here. That being said, this makes
the op less useful from other frontends, so...
Any other votes?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]