def disable_layer_logging():
    """
    Disable the shape logging for all layers from this moment on. Can be
    useful when creating multiple towers.
    """
    class ContainEverything:
        def __contains__(self, x):
            return True
    # can use nonlocal in python3, but how
    globals()['_LAYER_LOGGED'] = ContainEverything()

    Disable the shape logging for all layers from this moment on. Can be
    useful when creating multiple towers.
    
tensorpack/models/registry.py