pytorch
d4529161 - [pruner] generalize bias hook for conv2d (#62430)

Commit
3 years ago
[pruner] generalize bias hook for conv2d (#62430) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/62430 The bias hook is a forward hook that is part of the pruning parametrization; it is attached after the activation reconstruction forward hook, so adding the bias occurs after zeros are reinserted to the pruned activation. This diff/PR amends the bias hook to work for Conv2d layers, in addition to Linear layers. The reshaping of the ._bias parameter ensures that it is added to the right dimension of the output. ghstack-source-id: 135097700 Test Plan: Added tests for `Conv2dB()`, a model with Conv2d layers that have `bias=True`. `buck test mode/dev-nosan //caffe2/test:ao -- TestBasePruner` https://pxl.cl/1MfgL Reviewed By: jerryzh168 Differential Revision: D29979571 fbshipit-source-id: c1a7e9fabc8b3c9d0050bd6b6c6a631ddfdf2a68
Author
Parents
Loading