Skip to content

Commit 23b274b

Browse files
Johannes Ballétensorflower-gardener
authored andcommitted
Adds support for compressed weights that are strings.
PiperOrigin-RevId: 368499605
1 parent e64880a commit 23b274b

File tree

1 file changed

+3
-1
lines changed
  • tensorflow_model_optimization/python/core/common/keras/compression/internal

1 file changed

+3
-1
lines changed

tensorflow_model_optimization/python/core/common/keras/compression/internal/optimize.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ def build(self, input_shape):
212212
*training_tensors)
213213
weights = []
214214
for t in compressed_tensors:
215-
weight = self.add_weight(name='TODO', shape=t.shape)
215+
weight = self.add_weight(
216+
name='TODO', dtype=t.dtype, shape=t.shape,
217+
initializer=tf.keras.initializers.Constant(t))
216218
weights.append(weight)
217219

218220
self.compressed_weights[attr_name] = weights

0 commit comments

Comments
 (0)