def test_trainer_loggers_property():
    """Test for correct initialization of loggers in Trainer."""
    logger1 = CustomLogger()
    logger2 = CustomLogger()

    # trainer.loggers should be a copy of the input list
    trainer = Trainer(logger=[logger1, logger2])

    assert trainer.loggers == [logger1, logger2]

    # trainer.loggers should create a list of size 1
    trainer = Trainer(logger=logger1)

    assert trainer.logger == logger1
    assert trainer.loggers == [logger1]

    # trainer.loggers should be a list of size 1 holding the default logger
    trainer = Trainer(logger=True)

    assert trainer.loggers == [trainer.logger]
    assert isinstance(trainer.logger, TensorBoardLogger)
Test for correct initialization of loggers in Trainer.
tests/tests_pytorch/trainer/properties/test_loggers.py