(model)
| 110 | |
| 111 | |
| 112 | def evaluate(model): |
| 113 | input_tensor = model.input_tensor |
| 114 | output_tensor = model.output_tensor if len(model.output_tensor) > 1 else model.output_tensor[0] |
| 115 | |
| 116 | iteration = -1 |
| 117 | calib_dataloader = MyDataloader(dataset=Dataset()) |
| 118 | for idx, (inputs, labels) in enumerate(calib_dataloader): |
| 119 | # dataloader should keep the order and len of inputs same with input_tensor |
| 120 | inputs = np.array([inputs]) |
| 121 | feed_dict = dict(zip(input_tensor, inputs)) |
| 122 | |
| 123 | start = time.time() |
| 124 | predictions = model.sess.run(output_tensor, feed_dict) |
| 125 | end = time.time() |
| 126 | |
| 127 | if idx + 1 == iteration: |
| 128 | break |
| 129 | |
| 130 | |
| 131 | class TestQuantizeModel(unittest.TestCase): |
nothing calls this directly
no test coverage detected
searching dependent graphs…