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 2020/12/17 00:11:37 UTC

[GitHub] [tvm] icemelon9 commented on a change in pull request #7120: [PatternLang] Add Syntatic Sugar to the C++ pattern API and support DataType Attribute Matching

icemelon9 commented on a change in pull request #7120:
URL: https://github.com/apache/tvm/pull/7120#discussion_r544714342



##########
File path: include/tvm/relay/dataflow_pattern.h
##########
@@ -46,6 +48,29 @@ class DFPatternNode : public Object {
  */
 class DFPattern : public ObjectRef {
  public:
+  /*! \brief Syntatic Sugar for creating a CallPattern */
+  DFPattern operator()(const std::vector<DFPattern>& args);
+  /*! \brief Syntatic Sugar for creating a CallPattern with an "add" op */

Review comment:
       I feel that the syntactic sugar "+-*/" is not necessary since we have the "IsOp" one, and it may cause some confusion whether you're adding two patterns together or use the "add" op.

##########
File path: tests/cpp/dataflow_pattern_test.cc
##########
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <gtest/gtest.h>
+#include <tvm/relay/dataflow_pattern.h>
+#include <tvm/tir/analysis.h>
+

Review comment:
       Add a unit test for call?

##########
File path: include/tvm/relay/dataflow_pattern.h
##########
@@ -1,5 +1,4 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
+/* * Licensed to the Apache Software Foundation (ASF) under one

Review comment:
       revert this change




----------------------------------------------------------------
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:
users@infra.apache.org