(model, out_file)
Add a logger that will log memory usage to the given file.

    Used to debug OOM errors.
Add a logger that will log memory usage to the given file.
Add a logger that will log memory usage to the given file .
def set_logger(model, out_file):
    """Add a logger that will log memory usage to the given file.

    Used to debug OOM errors.
    """
    logging.basicConfig(
        level="INFO", format="%(asctime)s:%(levelname)s: %(message)s", stream=out_file
    )
    model.attrs["logger"] = logging.getLogger(__name__)
def set_logger ( model , out_file ) : logging . basicConfig ( level = "INFO" , format = "%(asctime)s:%(levelname)s: %(message)s" , stream = out_file ) model . attrs [ "logger" ] = logging . getLogger ( __name__ )