ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci_eval_verifier_ref Namespace Reference

Functions

 dtype_from_file (file_path)
 

Variables

 parser = argparse.ArgumentParser()
 
 type
 
 str
 
 required
 
 args = parser.parse_args()
 
 driver = args.driver
 
str circle_model_ref = args.model_ref + ".circle"
 
str circle_model = args.work_path + ".circle"
 
int rtolf32 = 1e-5
 
int atolf32 = 1e-5
 
int rtolint = 0
 
int atolint = 0
 
int check_input = 0
 
str input_file_path = circle_model_ref + ".input" + str(check_input)
 
int num_inputs = check_input
 
int check_output = 0
 
str output_file_path = circle_model_ref + ".output" + str(check_output)
 
int num_outputs = check_output
 
 check
 
 output_dtype = dtype_from_file(circle_model_ref + ".output" + str(idx) + ".dtype")
 
 shape_file = open(circle_model_ref + ".output" + str(idx) + ".shape", 'r')
 
list output_shape = [int(i) for i in shape_file.read().split(',')]
 
 output_data_ref = np.fromfile(circle_model_ref + ".output" + str(idx), output_dtype)
 
 luci_output_data_ref = np.reshape(output_data_ref, output_shape)
 
 output_data = np.fromfile(circle_model + ".output" + str(idx), output_dtype)
 
 luci_output_data = np.reshape(output_data, output_shape)
 
 rtol
 
 atol
 

Function Documentation

◆ dtype_from_file()

luci_eval_verifier_ref.dtype_from_file (   file_path)

Definition at line 25 of file luci_eval_verifier_ref.py.

25def dtype_from_file(file_path):
26 with open(file_path, 'r') as dtype_file:
27 dtype_str = dtype_file.read()
28 if dtype_str == "float32":
29 return np.float32
30 if dtype_str == "uint8":
31 return np.uint8
32 if dtype_str == "int16":
33 return np.int16
34 if dtype_str == "int32":
35 return np.int32
36 if dtype_str == "int64":
37 return np.int64
38 if dtype_str == "bool":
39 return np.bool_
40 raise SystemExit("Unsupported dtype from file", dtype_str)
41
42

Variable Documentation

◆ args

luci_eval_verifier_ref.args = parser.parse_args()

Definition at line 49 of file luci_eval_verifier_ref.py.

◆ atol

luci_eval_verifier_ref.atol

Definition at line 122 of file luci_eval_verifier_ref.py.

◆ atolf32

luci_eval_verifier_ref.atolf32 = 1e-5

Definition at line 57 of file luci_eval_verifier_ref.py.

◆ atolint

luci_eval_verifier_ref.atolint = 0

Definition at line 60 of file luci_eval_verifier_ref.py.

◆ check

luci_eval_verifier_ref.check

Definition at line 103 of file luci_eval_verifier_ref.py.

◆ check_input

int luci_eval_verifier_ref.check_input = 0

Definition at line 73 of file luci_eval_verifier_ref.py.

◆ check_output

int luci_eval_verifier_ref.check_output = 0

Definition at line 86 of file luci_eval_verifier_ref.py.

◆ circle_model

str luci_eval_verifier_ref.circle_model = args.work_path + ".circle"

Definition at line 53 of file luci_eval_verifier_ref.py.

◆ circle_model_ref

str luci_eval_verifier_ref.circle_model_ref = args.model_ref + ".circle"

Definition at line 52 of file luci_eval_verifier_ref.py.

◆ driver

luci_eval_verifier_ref.driver = args.driver

Definition at line 51 of file luci_eval_verifier_ref.py.

◆ input_file_path

str luci_eval_verifier_ref.input_file_path = circle_model_ref + ".input" + str(check_input)

Definition at line 75 of file luci_eval_verifier_ref.py.

◆ luci_output_data

luci_eval_verifier_ref.luci_output_data = np.reshape(output_data, output_shape)

Definition at line 115 of file luci_eval_verifier_ref.py.

◆ luci_output_data_ref

luci_eval_verifier_ref.luci_output_data_ref = np.reshape(output_data_ref, output_shape)

Definition at line 112 of file luci_eval_verifier_ref.py.

◆ num_inputs

int luci_eval_verifier_ref.num_inputs = check_input

Definition at line 77 of file luci_eval_verifier_ref.py.

◆ num_outputs

int luci_eval_verifier_ref.num_outputs = check_output

Definition at line 90 of file luci_eval_verifier_ref.py.

◆ output_data

luci_eval_verifier_ref.output_data = np.fromfile(circle_model + ".output" + str(idx), output_dtype)

Definition at line 114 of file luci_eval_verifier_ref.py.

◆ output_data_ref

luci_eval_verifier_ref.output_data_ref = np.fromfile(circle_model_ref + ".output" + str(idx), output_dtype)

Definition at line 111 of file luci_eval_verifier_ref.py.

◆ output_dtype

luci_eval_verifier_ref.output_dtype = dtype_from_file(circle_model_ref + ".output" + str(idx) + ".dtype")

Definition at line 107 of file luci_eval_verifier_ref.py.

◆ output_file_path

str luci_eval_verifier_ref.output_file_path = circle_model_ref + ".output" + str(check_output)

Definition at line 88 of file luci_eval_verifier_ref.py.

◆ output_shape

list luci_eval_verifier_ref.output_shape = [int(i) for i in shape_file.read().split(',')]

Definition at line 109 of file luci_eval_verifier_ref.py.

◆ parser

luci_eval_verifier_ref.parser = argparse.ArgumentParser()

Definition at line 43 of file luci_eval_verifier_ref.py.

◆ required

luci_eval_verifier_ref.required

Definition at line 44 of file luci_eval_verifier_ref.py.

◆ rtol

luci_eval_verifier_ref.rtol

Definition at line 121 of file luci_eval_verifier_ref.py.

◆ rtolf32

luci_eval_verifier_ref.rtolf32 = 1e-5

Definition at line 56 of file luci_eval_verifier_ref.py.

◆ rtolint

luci_eval_verifier_ref.rtolint = 0

Definition at line 59 of file luci_eval_verifier_ref.py.

◆ shape_file

luci_eval_verifier_ref.shape_file = open(circle_model_ref + ".output" + str(idx) + ".shape", 'r')

Definition at line 108 of file luci_eval_verifier_ref.py.

◆ str

luci_eval_verifier_ref.str

Definition at line 44 of file luci_eval_verifier_ref.py.

◆ type

luci_eval_verifier_ref.type

Definition at line 44 of file luci_eval_verifier_ref.py.