You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/10/12 20:27:35 UTC

[GitHub] [tvm] masahi commented on a change in pull request #9184: [Relay, TOPI] Add searchsorted op

masahi commented on a change in pull request #9184:
URL: https://github.com/apache/tvm/pull/9184#discussion_r727476180



##########
File path: include/tvm/relay/attrs/algorithm.h
##########
@@ -76,6 +76,19 @@ struct TopKAttrs : public tvm::AttrsNode<TopKAttrs> {
   }
 };
 
+struct SearchSortedAttrs : public tvm::AttrsNode<SearchSortedAttrs> {
+  std::string side;
+  DataType dtype;
+
+  TVM_DECLARE_ATTRS(SearchSortedAttrs, "relay.attrs.SearchSortedAttrs") {
+    TVM_ATTR_FIELD(side).set_default("left").describe(
+        "Controls which index is returned if a value lands exactly on one of sorted values.");
+    TVM_ATTR_FIELD(dtype)
+        .set_default(DataType::Int(32))

Review comment:
       Right, other ops have `NullValue<DataType>()` as the default here, but if we look at the python definition at https://github.com/apache/tvm/blob/main/python/tvm/relay/op/algorithm.py#L47, they say the default is int32. So I thought we should make that explicit in `attrs/algorithm.h` as well.




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org