Skip to content

Commit

Permalink
fix python encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
transcranial committed Dec 6, 2017
1 parent 953b4d7 commit 4d10d39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/encoder.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env python

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import os
import h5py
import numpy as np
Expand Down Expand Up @@ -70,7 +76,7 @@ def serialize(self):
w.layer_name = layer_name
w.weight_name = weight_name
w.shape.extend(list(weight_value.shape))
if quantize:
if self.quantize:
w.type = 'uint8'
quantized, min_val, max_val = quantize_arr(weight_value)
w.data = quantized.astype(np.uint8).tobytes()
Expand Down

0 comments on commit 4d10d39

Please sign in to comment.