comaniac commented on a change in pull request #7144:
URL: https://github.com/apache/tvm/pull/7144#discussion_r547386833



##########
File path: python/tvm/auto_scheduler/measure_record.py
##########
@@ -98,6 +98,46 @@ def __iter__(self):
             yield ret[0], ret[1]  # (input, result)
 
 
+def load_record_from_string(record):
+    """
+    Load the measure record from string.
+
+    Parameters
+    ----------
+    record: str
+        A record string, including the serialized MeausreInput and 
MeasureResult.
+
+    Returns
+    -------
+    ret: Tuple[MeasureInput, MeasureResult, str]
+        A tuple of MeasureInput, MeasureResult, and the log version.
+    """
+    return _ffi_api.ReadMeasureRecord(record)
+
+
+def dump_record_to_string(inp, res, log_version):
+    """
+    Dump the measure record to a string.
+
+    Parameters
+    ----------
+    inp: MeasureInput
+        The measure input.
+
+    res: MeasureResult
+        The measure result.
+
+    log_version: str
+        The log version of the given record.
+
+    Returns
+    -------
+    ret: str
+        The dumped string.
+    """
+    return _ffi_api.WriteMeasureRecords(inp, res, log_version)

Review comment:
       I was thinking about the is too, but if we don't then load and dump APIs 
cannot reverse each other, because it writes the latest version by default. It 
means if you load a record in v0.3 and write it back, it becomes v0.4.
   
   A more general solution should be embedding the log version to MeasureInput 
like AutoTVM.




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