pytorch
37ca5a8a - convert_sync_batchnorm should not convert _InstanceNorm instances (#29985)

Commit
5 years ago
convert_sync_batchnorm should not convert _InstanceNorm instances (#29985) Summary: Fixes https://github.com/pytorch/pytorch/issues/29187 This introduces a new class `_NormBase` that `_InstanceNorm` and `_BatchNorm` inherit from separately. This means the `isinstance(module, _BatchNorm)` check won't falsely pass for `_InstanceNorm`. The suggested fix of adding `and not isinstance(module, _InstanceNorm)` works as well, but requires introducing a cyclic dependency between `instancenorm.py` and `batchnorm.py`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/29985 Differential Revision: D18588104 Pulled By: yf225 fbshipit-source-id: f599da3b902ad9c56836db4d429bfc462ed51338
Author
Parents
Loading