ONE - On-device Neural Engine
|
Functions | |
compare_fake_quantization (tensor, tensor_name, expect_dir) | |
compare_record_minmax (tensor, tensor_name, expect_dir) | |
compare_quantization (tensor, tensor_name, expect_dir) | |
chunks (lst, n) | |
Variables | |
parser = argparse.ArgumentParser() | |
type | |
required | |
nargs | |
help | |
str | |
True | |
args = parser.parse_args() | |
dict | modes_to_expected_folder |
dict | modes_to_input_h5_suffix |
test_param = args.test_param | |
bin_dir = args.bin_dir | |
source_dir = args.source_dir | |
mode = args.mode | |
str | log_format = '%(levelname)s: %(message)s' |
formatter = logging.Formatter(log_format) | |
streamer = StringIO() | |
stream_handler = logging.StreamHandler(stream=streamer) | |
handlers | |
failed_log = dict() | |
inputs = test_param[0].split() | |
int | PARAM_SET_SIZE = 3 |
model_name = inputs[idx][0] | |
granularity = inputs[idx][1] | |
dtype = inputs[idx][2] | |
str | testcase = f'{model_name}.{granularity}.{dtype}' |
test_result_file = os.path.join(bin_dir, testcase) | |
str | input_h5 = f'{test_result_file}.{modes_to_input_h5_suffix[mode]}' |
str | expect_dir = f'{source_dir}/expected_outputs/{model_name}/{granularity}/{dtype}/{modes_to_expected_folder[mode]}' |
bool | test_result = False |
failed_number = len(failed_log) | |
compare_tensors_all.chunks | ( | lst, | |
n | |||
) |
Yield successive n-sized chunks from the list
Definition at line 148 of file compare_tensors_all.py.
compare_tensors_all.compare_fake_quantization | ( | tensor, | |
tensor_name, | |||
expect_dir | |||
) |
Definition at line 73 of file compare_tensors_all.py.
References str.
compare_tensors_all.compare_quantization | ( | tensor, | |
tensor_name, | |||
expect_dir | |||
) |
Definition at line 105 of file compare_tensors_all.py.
References str.
compare_tensors_all.compare_record_minmax | ( | tensor, | |
tensor_name, | |||
expect_dir | |||
) |
Definition at line 86 of file compare_tensors_all.py.
References str.
compare_tensors_all.args = parser.parse_args() |
Definition at line 32 of file compare_tensors_all.py.
compare_tensors_all.bin_dir = args.bin_dir |
Definition at line 54 of file compare_tensors_all.py.
compare_tensors_all.dtype | ( | void | ) | = inputs[idx][2] |
Definition at line 162 of file compare_tensors_all.py.
str compare_tensors_all.expect_dir = f'{source_dir}/expected_outputs/{model_name}/{granularity}/{dtype}/{modes_to_expected_folder[mode]}' |
Definition at line 169 of file compare_tensors_all.py.
compare_tensors_all.failed_log = dict() |
Definition at line 154 of file compare_tensors_all.py.
compare_tensors_all.failed_number = len(failed_log) |
Definition at line 195 of file compare_tensors_all.py.
compare_tensors_all.formatter = logging.Formatter(log_format) |
Definition at line 62 of file compare_tensors_all.py.
compare_tensors_all.granularity = inputs[idx][1] |
Definition at line 161 of file compare_tensors_all.py.
compare_tensors_all.handlers |
Definition at line 66 of file compare_tensors_all.py.
compare_tensors_all.help |
Definition at line 20 of file compare_tensors_all.py.
str compare_tensors_all.input_h5 = f'{test_result_file}.{modes_to_input_h5_suffix[mode]}' |
Definition at line 166 of file compare_tensors_all.py.
compare_tensors_all.inputs = test_param[0].split() |
Definition at line 155 of file compare_tensors_all.py.
str compare_tensors_all.log_format = '%(levelname)s: %(message)s' |
Definition at line 61 of file compare_tensors_all.py.
compare_tensors_all.mode = args.mode |
Definition at line 56 of file compare_tensors_all.py.
compare_tensors_all.model_name = inputs[idx][0] |
Definition at line 160 of file compare_tensors_all.py.
dict compare_tensors_all.modes_to_expected_folder |
Definition at line 34 of file compare_tensors_all.py.
dict compare_tensors_all.modes_to_input_h5_suffix |
Definition at line 43 of file compare_tensors_all.py.
compare_tensors_all.nargs |
Definition at line 19 of file compare_tensors_all.py.
int compare_tensors_all.PARAM_SET_SIZE = 3 |
Definition at line 156 of file compare_tensors_all.py.
compare_tensors_all.parser = argparse.ArgumentParser() |
Definition at line 14 of file compare_tensors_all.py.
compare_tensors_all.required |
Definition at line 18 of file compare_tensors_all.py.
compare_tensors_all.source_dir = args.source_dir |
Definition at line 55 of file compare_tensors_all.py.
compare_tensors_all.str |
Definition at line 31 of file compare_tensors_all.py.
Referenced by compare_fake_quantization(), compare_quantization(), and compare_record_minmax().
compare_tensors_all.stream_handler = logging.StreamHandler(stream=streamer) |
Definition at line 64 of file compare_tensors_all.py.
compare_tensors_all.streamer = StringIO() |
Definition at line 63 of file compare_tensors_all.py.
compare_tensors_all.test_param = args.test_param |
Definition at line 53 of file compare_tensors_all.py.
compare_tensors_all.test_result = False |
Definition at line 171 of file compare_tensors_all.py.
Definition at line 165 of file compare_tensors_all.py.
str compare_tensors_all.testcase = f'{model_name}.{granularity}.{dtype}' |
Definition at line 164 of file compare_tensors_all.py.
compare_tensors_all.True |
Definition at line 31 of file compare_tensors_all.py.
compare_tensors_all.type |
Definition at line 17 of file compare_tensors_all.py.