Skip to content

Commit

Permalink
Search for resnet34. (apache#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengJiang authored and hypercubestart committed Mar 12, 2021
1 parent b8b07ad commit 1388f81
Show file tree
Hide file tree
Showing 4 changed files with 1,623 additions and 10 deletions.
6 changes: 2 additions & 4 deletions python/tvm/hago/quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ def fvisit(node):
src, _ = edge
eidx = edge2idx[edge]
in_scale = infer_scale_for_node(src)
print(type(in_scale))
in_scales.append(in_scale.tolist())
in_dtypes.append(prov_dtypes[node2idx[src]])
out_dtypes.append(req_dtypes[eidx])
Expand All @@ -462,7 +461,6 @@ def fvisit(node):
if isinstance(out_scale, float):
out_scale = np.float32(out_scale)

print(type(out_scale))
out_scales.append(out_scale.tolist())

rectified_output_scales = None
Expand Down Expand Up @@ -576,7 +574,7 @@ def visit_call(self, node):
new_node = super().visit_call(node)
if new_node.op.name == "nn.simulated_quantize":
print('---------')
# print('simulated_quantize({})'.format(node_str(node.args[0], self._snode2idx)))
print('simulated_quantize({})'.format(node_str(node.args[0], self._snode2idx)))
new_node = self._realize_simulated_quantize(new_node)
return new_node
nidx = self._node2idx[self._snode2node[node]]
Expand All @@ -602,7 +600,7 @@ def _realize_simulated_quantize(self, node):
clip_max = to_scalar(clip_max)
print(' in_scale: {}'.format(in_scale))
print(' out_scale: {}'.format(out_scale))
print(' axis: {}'.format(axis))
print(' axis: {}'.format(axis))

if in_dtype == 'float32' and out_dtype == 'float32':
# do nothing
Expand Down
Loading

0 comments on commit 1388f81

Please sign in to comment.