Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuse the module concern #7

Open
kent252 opened this issue May 16, 2024 · 0 comments
Open

Fuse the module concern #7

kent252 opened this issue May 16, 2024 · 0 comments

Comments

@kent252
Copy link

kent252 commented May 16, 2024

Dear author,
Thank you for your precious blogs and repo. I am learning about quantization and your tutorial is very helpful. However, I just wonder why we need to fuse this module. # Fuse the model in place rather manually. fused_model = torch.quantization.fuse_modules(fused_model, [["conv1", "bn1", "relu"]], inplace=True) for module_name, module in fused_model.named_children(): if "layer" in module_name: for basic_block_name, basic_block in module.named_children(): torch.quantization.fuse_modules(basic_block, [["conv1", "bn1", "relu1"], ["conv2", "bn2"]], inplace=True) for sub_block_name, sub_block in basic_block.named_children(): if sub_block_name == "downsample": torch.quantization.fuse_modules(sub_block, [["0", "1"]], inplace=True). Can you address it for me. Thank you

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

No branches or pull requests

1 participant