Skip to content

Cleanup pqlayers#60

Draft
nroope wants to merge 1 commit into
devfrom
cleanup-pqlayers
Draft

Cleanup pqlayers#60
nroope wants to merge 1 commit into
devfrom
cleanup-pqlayers

Conversation

@nroope

@nroope nroope commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@nroope
nroope changed the base branch from main to dev July 16, 2026 12:16
@nroope
nroope requested a review from nastiapetrovych July 16, 2026 12:16
@nroope nroope self-assigned this Jul 16, 2026

@nastiapetrovych nastiapetrovych left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nroope, nice work improving the readability of PQLayers. Could you, please, add a short summary of the main changes to the PR description?

The main comment I have is that layers modules are quite huge, that makes different to orient within the changes or functionalities. Maybe, we can find a solution how to split them in smaller and clearer functional parts? Also, how to deal with overlap of keras and torch much better?

I've also left a few inline comments within the code to change, let me know if sth is unclear.

Comment thread src/pquant/core/keras/layers.py Outdated
Comment thread src/pquant/core/keras/layers.py Outdated
Comment thread src/pquant/core/keras/layers.py Outdated
Comment thread src/pquant/core/torch/quantizer.py Outdated
return AutoSparse(config, layer_type)
elif pruning_method == "cs":
return ContinuousSparsification(config, layer_type)
elif pruning_method == "fitcompress":

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using multiple if conditions here, you can define a dictionary that maps each pruning method to its corresponding pruning class -> then you can simply look up the appropriate class and instantiate it in a single line

Comment thread tests/test_torch_pruning_layers.py Outdated
Comment thread tests/test_torch_pruning_layers.py
Comment thread tests/test_torch_pruning_layers.py
Comment thread tests/test_torch_pruning_layers.py Outdated
Comment thread tests/test_torch_pruning_layers.py Outdated
@nroope
nroope force-pushed the cleanup-pqlayers branch from 27aa591 to da85c80 Compare July 23, 2026 09:19
@nroope
nroope force-pushed the cleanup-pqlayers branch from da85c80 to 5ccf63a Compare July 23, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants