class_docstr: A measurement callback that writes measurement records into a file.
  
  Parameters
  ----------
  filename : str
      File name for this callback to write log to.
class_docstr_tok: ["A","measurement","callback","that","writes","measurement","records","into","a","file",".","Parameters","--","--","--","--","--","filename",":","str","File","name","for","this","callback","to","write","log","to","."]
code: def __init__(self, filename):
      dirname = os.path.dirname(os.path.abspath(filename))
      if not os.path.exists(dirname):
          os.makedirs(dirname)
      self.__init_handle_by_constructor__(
          _ffi_api.RecordToFile, filename
      )
  
imports: import argparse
  import logging
  import os
  import itertools
  import numpy
  import tvm._ffi
  from tvm.runtime import Object
  from .measure import MeasureErrorNo, MeasureCallback
  from .utils import calc_workload_dis_factor, decode_workload_key
  from .None import _ffi_api
label_desc: Use image node_id 1 to create a new RecordToFile object from inherited base classes: MeasureCallback with example: obj = RecordToFile(filename)