would using m.named_modules() work? I think yes but I guess since replace_bn(ch, n) is already recursing it’s not necessary to recurse again…
it seems it worked in my use case, thanks for the code and for not being snobbish!