(file, data_type=mace_pb2.DT_FLOAT)
| 28 | |
| 29 | |
| 30 | def 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 | |
| 41 | def calculate_sqnr(expected, actual): |
no outgoing calls
no test coverage detected