junrushao1994 commented on a change in pull request #6369:
URL: https://github.com/apache/incubator-tvm/pull/6369#discussion_r485271387



##########
File path: src/target/target.cc
##########
@@ -57,119 +72,216 @@ static std::vector<String> DeduplicateKeys(const 
std::vector<String>& keys) {
   return new_keys;
 }
 
-static inline std::string RemovePrefixDashes(const std::string& s) {
-  size_t n_dashes = 0;
-  for (; n_dashes < s.length() && s[n_dashes] == '-'; ++n_dashes) {
+template <class TObj>
+static const TObj* ObjTypeCheck(const ObjectRef& obj, const std::string& 
expected_type) {
+  const TObj* ptr = obj.as<TObj>();
+  if (ptr == nullptr) {
+    std::ostringstream os;
+    os << ": Expects type \"" << expected_type << "\", but gets \"" << 
obj->GetTypeKey()

Review comment:
       I was thinking about this too, but sometimes the type keys are not 
accurate. For example, the type key of `Integer` is `IntImm`...




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


Reply via email to