Skip to content

Commit

Permalink
set_attrs_type_key and test_format testcase added
Browse files Browse the repository at this point in the history
  • Loading branch information
siju-samuel committed Oct 27, 2018
1 parent 09a1a9a commit deb1df4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/tvm/relay/attrs/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ struct SplitAttrs : public tvm::AttrsNode<SplitAttrs> {
"the entries indicate where along axis the array is split.");
TVM_ATTR_FIELD(axis).set_default(0)
.describe("the axis to be splitted.");
}
};

/*! \brief Attributes for StridedSlice operator */
struct StridedSliceAttrs : public tvm::AttrsNode<StridedSliceAttrs> {
Array<IndexExpr> begin;
Expand All @@ -134,7 +137,6 @@ struct StridedSliceAttrs : public tvm::AttrsNode<StridedSliceAttrs> {
.describe("Stride values of the slice");
}
};

} // namespace relay
} // namespace tvm
#endif // TVM_RELAY_ATTRS_TRANSFORM_H_
2 changes: 1 addition & 1 deletion python/tvm/relay/op/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ def split(data, indices_or_sections, axis=0):
ret_size = len(indices_or_sections) + 1
return TupleWrapper(_make.split(data, indices_or_sections, axis), ret_size)


def strided_slice(data, begin, end, stride=None):
"""Strided slice of an array..
Expand All @@ -339,4 +340,3 @@ def strided_slice(data, begin, end, stride=None):
"""
stride = stride or []
return _make.strided_slice(data, list(begin), list(end), list(stride))
>>>>>>> [RELAY][OP]Strided slice
1 change: 1 addition & 0 deletions src/relay/op/tensor/transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ Examples::
.set_num_inputs(1)
.add_argument("data", "Tensor", "The input tensor.")
.set_support_level(4)
.set_attrs_type_key("relay.attrs.StridedSliceAttrs")
.add_type_rel("StridedSlice", StridedSliceRel);

// Split
Expand Down

0 comments on commit deb1df4

Please sign in to comment.