示例#1
0
def get_sample_records(n):
    """get sample records for testing"""
    tsk, target = get_sample_task()

    inps, ress = [], []
    for i in range(n):
        inps.append(MeasureInput(target, tsk, tsk.config_space.get(i)))
        ress.append(MeasureResult((i + 1, ), 0, i, time.time()))
    return list(zip(inps, ress))
示例#2
0
    def custom_measure(input_pack, build_func, build_args, number, repeat,
                       ref_input, ref_output):
        from tvm.autotvm import MeasureResult

        results = []
        for inp in input_pack:
            tic = time.time()
            # do nothing
            time.sleep(0.001)
            results.append(MeasureResult([time.time() - tic], 0,
                                         time.time() - tic, time.time()))
        return results
示例#3
0
    def measure_batch(inputs):
        from tvm.autotvm import MeasureResult

        results = []
        for inp in inputs:
            tic = time.time()
            # do nothing
            time.sleep(0.001)
            results.append(
                MeasureResult([time.time() - tic], 0,
                              time.time() - tic, time.time()))
        return results
示例#4
0
 def run(self, measure_inputs, build_results):
     return [
         MeasureResult((np.random.random(), ), 0, 0.2, time.time())
         for _ in range(len(measure_inputs))
     ]