INNER CODE UNIT · Python
assert_and_infer_cfg
nv-tlabs/GSCNN · config.py:73
def assert_and_infer_cfg(args, make_immutable=True):
"""Call this function in your script after you have finished setting all cfg
values that are necessary (e.g., merging a config from a file, merging
command line config options, etc.). By default, this function will also
mark the global cfg as immutable to prevent changing the global cfg settings
during script execution (which can lead to hard to debug errors or code
that's harder to understand than is necessary).
"""
if args.batch_weighting:
__C.BATCH_WEIGHTING=True
if args.syncbn:
import encoding
__C.MODEL.BN = 'syncnorm'
__C.MODEL.BNFUNC = encoding.nn.BatchNorm2d
else:
__C.MODEL.BNFUNC = torch.nn.BatchNorm2d