Closed james77777778 closed 3 weeks ago
This PR fixes unexpected dtype policy changes when quantization fails.
For example, the current codebase will output False in the following snippet:
False
import numpy as np from keras import layers layer = layers.Embedding(10, 16) layer.build() x = np.random.randint(0, 9, size=(1, 3)) original_dtype_policy = layer.dtype_policy try: layer.quantize("float8") # Will fail except: pass print(original_dtype_policy == layer.dtype_policy) # False
With this PR, the output will be True.
True
This PR fixes unexpected dtype policy changes when quantization fails.
For example, the current codebase will output
False
in the following snippet:With this PR, the output will be
True
.