MCPcopy Create free account
hub / github.com/intel/neural-compressor / evaluate

Function evaluate

test/tensorflow/test_quantize_model.py:112–128  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

110
111
112def 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
131class TestQuantizeModel(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

MyDataloaderClass · 0.70
DatasetClass · 0.70
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…