Thank for your suggestion.
We could use add_module to replace your own custom function in PyTorch.
firstbn = resnet.layer1
firstbn[0].add_module('bn1', ABN(64))
firstbn[1].add_module('bn1', ABN(64))

ABN is my own class to replace bn1 normalization layer, if we use the same name bn1, it will replace the old module with our own custom module.