tqchen commented on a change in pull request #6078:
URL: https://github.com/apache/incubator-tvm/pull/6078#discussion_r468908098



##########
File path: include/tvm/node/container.h
##########
@@ -1287,6 +1287,18 @@ class Map : public ObjectRef {
     data_ = other.data_;
     return *this;
   }
+  /*!
+   * \brief Merge with another Map. It does not mutate the current one.
+   * \param other Map to be merged.
+   * @return The merged Array. Original Map is kept unchanged.
+   */
+  Map<K, V> Merge(const Map<K, V>& other) const {

Review comment:
       Shall we make it as a global function instead of member? so it is not 
ambiguitous (that the result is a new map)

##########
File path: include/tvm/runtime/container.h
##########
@@ -956,6 +956,19 @@ class Array : public ObjectRef {
     return static_cast<ArrayNode*>(data_.get());
   }
 
+  /*!
+   * \brief Concat with another Array. It does not mutate the current one.
+   * \param other Array to be concatenated.
+   * @return The concatenated Array. Original Array is kept unchanged.
+   */
+  Array<T> Concat(const Array<T>& other) const {

Review comment:
       Consider make it as a global function, which also enables copy on write 
on the lhs(this)




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