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 2022/04/07 10:41:34 UTC
[GitHub] [tvm] mikepapadim opened a new pull request, #10929: [Relay][AST] Add WithFields for Constant and GlobalVar
mikepapadim opened a new pull request, #10929:
URL: https://github.com/apache/tvm/pull/10929
Co-authored-by: Mark Shields <mb...@octoml.ai>
This PR implements `WithFields` for Constant and GlobalVar.
--
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
[GitHub] [tvm] mbaret commented on a diff in pull request #10929: [Relay][AST] Add WithFields for Constant and GlobalVar
Posted by GitBox <gi...@apache.org>.
mbaret commented on code in PR #10929:
URL: https://github.com/apache/tvm/pull/10929#discussion_r849633077
##########
tests/cpp/withfields_test.cc:
##########
@@ -0,0 +1,53 @@
+/*
+ * 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/parser/parser.h>
+#include <tvm/relay/attrs/transform.h>
+#include <tvm/relay/dataflow_matcher.h>
+#include <tvm/relay/dataflow_pattern.h>
+#include <tvm/relay/function.h>
+
+namespace tvm {
+namespace relay {
+namespace {
+
+TEST(WithFields, GlobalVar) {
+ auto tensor_type = relay::TensorType({}, DataType::Bool());
+ GlobalVar func_init("dummy_func", tensor_type, {});
+ GlobalVar func_cp = WithFields(func_init);
+ ICHECK(func_init->name_hint == func_cp->name_hint);
+ ICHECK(func_init->span == func_cp->span);
+ ICHECK(func_init->checked_type_ == func_cp->checked_type_);
Review Comment:
I think we need to explicitly set these fields so that we know they're being preserved by WithFields (same for next test).
--
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
Re: [PR] [Relay][AST] Add WithFields for Constant and GlobalVar [tvm]
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen closed pull request #10929: [Relay][AST] Add WithFields for Constant and GlobalVar
URL: https://github.com/apache/tvm/pull/10929
--
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
[GitHub] [tvm] mikepapadim commented on pull request #10929: [Relay][AST] Add WithFields for Constant and GlobalVar
Posted by GitBox <gi...@apache.org>.
mikepapadim commented on PR #10929:
URL: https://github.com/apache/tvm/pull/10929#issuecomment-1097833184
PTAL this one now introduces cpp tests for the `WithFields`
--
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
[GitHub] [tvm] mbaret commented on pull request #10929: [Relay][AST] Add WithFields for Constant and GlobalVar
Posted by GitBox <gi...@apache.org>.
mbaret commented on PR #10929:
URL: https://github.com/apache/tvm/pull/10929#issuecomment-1091649905
I think this PR needs some more detail on what it's adding and why (is this part of a larger issue/RFC?) It should also include some simple tests to demonstrate the functionality.
--
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