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/11/07 09:31:48 UTC

[GitHub] [incubator-tvm] merrymercy commented on a change in pull request #6842: [AutoScheduler] Make SearchTask and ComputeDAG serializable

merrymercy commented on a change in pull request #6842:
URL: https://github.com/apache/incubator-tvm/pull/6842#discussion_r519157759



##########
File path: python/tvm/auto_scheduler/compute_dag.py
##########
@@ -182,3 +187,11 @@ def hash_key(self):
 
         str_key = str_key.encode(encoding="utf-8")
         return hashlib.md5(str_key).hexdigest()
+
+    def __getstate__(self):
+        return {"compute": SaveJSON(self.compute), "sche": SaveJSON(self.sche)}
+
+    def __setstate__(self, state):
+        self.compute = LoadJSON(state["compute"])  # pylint: disable=assignment-from-no-return

Review comment:
       @comaniac Do we need to explicitly call `SaveJSON`, `LoadJSON` here?
   I find that you don't call it in the `SearchTask::__getstate__`




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