MCPcopy Create free account
hub / github.com/XiaoMi/mace / load_data

Function load_data

tools/python/validate.py:30–38  ·  view source on GitHub ↗
(file, data_type=mace_pb2.DT_FLOAT)

Source from the content-addressed store, hash-verified

28
29
30def load_data(file, data_type=mace_pb2.DT_FLOAT):
31 if os.path.isfile(file):
32 if data_type == mace_pb2.DT_FLOAT or \
33 data_type == mace_pb2.DT_FLOAT16 or \
34 data_type == mace_pb2.DT_BFLOAT16:
35 return np.fromfile(file=file, dtype=np.float32)
36 elif data_type == mace_pb2.DT_INT32:
37 return np.fromfile(file=file, dtype=np.int32)
38 return np.empty([0])
39
40
41def calculate_sqnr(expected, actual):

Callers 7

validate_with_fileFunction · 0.70
validate_tf_modelFunction · 0.70
validate_pytorch_modelFunction · 0.70
validate_caffe_modelFunction · 0.70
validate_onnx_modelFunction · 0.70
validate_megengine_modelFunction · 0.70
validate_keras_modelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected