Skip to content
Merged
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
4 changes: 2 additions & 2 deletions neural_compressor/torch/algorithms/weight_only/rtn.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def rtn_quantize(
model.to(device)

assert isinstance(model, torch.nn.Module), "only support torch module"
supported_layers = ["Linear"]
supported_layers = (torch.nn.Linear,)
# initialize global configuration
double_quant_config = {
"double_quant": kwargs.get("use_double_quant", False),
Expand All @@ -93,7 +93,7 @@ def rtn_quantize(
if export_compressed_model:
use_optimum_format = kwargs.get("use_optimum_format", True)
for name, m in model.named_modules():
if m.__class__.__name__ not in supported_layers:
if not isinstance(m, supported_layers):
continue
if name in weight_config: # pragma: no cover
# initialize op configuration
Expand Down