Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ def test_reduces_model_size_at_reasonable_accuracy(self):
self.assertGreater(accuracy, .9)

with self.subTest("compressed_weights_are_smaller"):
original_size = sum(
original_size = sum( # pyrefly: ignore[missing-attribute]
map(get_weight_size_in_bytes, model.weights)).numpy()
compressed_size = sum(
compressed_size = sum( # pyrefly: ignore[missing-attribute]
map(get_weight_size_in_bytes, compressed_model.weights)).numpy()
self.assertLess(compressed_size, 0.01 * original_size)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def create_layer_for_training(layer, algorithm):

input_shape = layer.input_shape

compressible_weights = algorithm.get_compressible_weights(layer)
compressible_weights = algorithm.get_compressible_weights(layer) # pyrefly: ignore[missing-attribute]

# Clone layer for two reasons:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self,
self.begin_step = begin_step
self.end_value = end_value
self.decay_steps = decay_steps
self.end_step = self.begin_step + self.decay_steps
self.end_step = self.begin_step + self.decay_steps # pyrefly: ignore[unsupported-operation]
self.exponent = exponent
self.dtype = dtype

Expand All @@ -111,7 +111,7 @@ def _during_decay(self, step: Union[int, tf.Tensor]) -> tf.Tensor:
"""Return decayed scheduled value."""

with tf.name_scope(self.name or "PolynomialDecay"):
local_steps = tf.cast(step - self.begin_step, dtype=tf.float32)
local_steps = tf.cast(step - self.begin_step, dtype=tf.float32) # pyrefly: ignore[unsupported-operation]
decay_term = tf.math.divide(local_steps,
tf.cast(self.decay_steps, dtype=tf.float32))
total_delta = tf.cast(self.start_value - self.end_value, dtype=tf.float32)
Expand Down
Loading