Skip to content

Commit

Permalink
Fix (float/clamp): Bugfix when unsigned
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfraser committed Dec 16, 2024
1 parent 482531c commit 248d83a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/brevitas/core/function_wrapper/clamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def forward(
# Compute masks
inf_mask = x.isinf()
p_max_val_mask = x > max_value
n_max_val_mask = -x > max_value
n_max_val_mask = x < min_value

# first clamp everything to +- max_value, basically the saturating case
x = self.saturating_clamp(x, max_value, min_value)
Expand Down

0 comments on commit 248d83a

Please sign in to comment.