Skip to content

Commit

Permalink
fix unbound variable error when not using torch or tf backend (#2)
Browse files Browse the repository at this point in the history
Refactor to use backend specific gradient functions in tests and merges logic into single function
  • Loading branch information
doncarlos999 authored Jan 6, 2025
1 parent 4d97345 commit 4007769
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 877 deletions.
7 changes: 1 addition & 6 deletions keras/api/_tf_keras/keras/quantizers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@
from keras.src.quantizers.quantizers import compute_float8_amax_history
from keras.src.quantizers.quantizers import compute_float8_scale
from keras.src.quantizers.quantizers import fake_quant_with_min_max_args
from keras.src.quantizers.quantizers import (
fake_quant_with_min_max_args_gradient,
)
from keras.src.quantizers.quantizers import fake_quant_with_min_max_vars
from keras.src.quantizers.quantizers import (
fake_quant_with_min_max_vars_per_channel,
)
from keras.src.quantizers.quantizers import (
fake_quant_with_min_max_vars_per_channel_gradient,
)
from keras.src.quantizers.quantizers import quantize_and_dequantize
7 changes: 1 addition & 6 deletions keras/api/quantizers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@
from keras.src.quantizers.quantizers import compute_float8_amax_history
from keras.src.quantizers.quantizers import compute_float8_scale
from keras.src.quantizers.quantizers import fake_quant_with_min_max_args
from keras.src.quantizers.quantizers import (
fake_quant_with_min_max_args_gradient,
)
from keras.src.quantizers.quantizers import fake_quant_with_min_max_vars
from keras.src.quantizers.quantizers import (
fake_quant_with_min_max_vars_per_channel,
)
from keras.src.quantizers.quantizers import (
fake_quant_with_min_max_vars_per_channel_gradient,
)
from keras.src.quantizers.quantizers import quantize_and_dequantize
7 changes: 1 addition & 6 deletions keras/src/quantizers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@
from keras.src.quantizers.quantizers import compute_float8_amax_history
from keras.src.quantizers.quantizers import compute_float8_scale
from keras.src.quantizers.quantizers import fake_quant_with_min_max_args
from keras.src.quantizers.quantizers import (
fake_quant_with_min_max_args_gradient,
)
from keras.src.quantizers.quantizers import fake_quant_with_min_max_vars
from keras.src.quantizers.quantizers import (
fake_quant_with_min_max_vars_per_channel,
)
from keras.src.quantizers.quantizers import (
fake_quant_with_min_max_vars_per_channel_gradient,
)
from keras.src.quantizers.quantizers import quantize_and_dequantize
from keras.src.saving import serialization_lib
from keras.src.utils.naming import to_snake_case
Expand Down
Loading

0 comments on commit 4007769

Please sign in to comment.