Skip to content

Commit

Permalink
fix bug (#170)
Browse files Browse the repository at this point in the history
* fix bug

* add arg to weight
  • Loading branch information
horheynm authored Sep 26, 2024
1 parent 6ed94e6 commit a852897
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/compressed_tensors/quantization/lifecycle/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,22 @@ def initialize_module_for_quantization(

if scheme.input_activations is not None:
_initialize_scale_zero_point_observer(
module, "input", scheme.input_activations
module,
"input",
scheme.input_activations,
force_zero_point=force_zero_point,
)
if scheme.weights is not None:
if hasattr(module, "weight"):
weight_shape = None
if isinstance(module, torch.nn.Linear):
weight_shape = module.weight.shape
_initialize_scale_zero_point_observer(
module, "weight", scheme.weights, weight_shape=weight_shape
module,
"weight",
scheme.weights,
weight_shape=weight_shape,
force_zero_point=force_zero_point,
)
else:
_LOGGER.warning(
Expand Down

0 comments on commit a852897

Please sign in to comment.