def test_tensorboard_log_graph(tmp_path, example_input_array):
    """Test that log graph works with both model.example_input_array and if array is passed externally."""
    model = BoringModel()
    if example_input_array is not None:
        model.example_input_array = None

    logger = TensorBoardLogger(tmp_path, log_graph=True)
    logger.log_graph(model, example_input_array)
Test that log graph works with both model.example_input_array and if array is passed externally.
tests/tests_pytorch/loggers/test_tensorboard.py