looking at this, there is some snippet, from here: https://github.com/pytorch/pytorch/blob/master/test/test_tensorboard.py 2
TEST_TENSORBOARD = True
try:
    import tensorboard.summary.writer.event_file_writer  # noqa F401
except ImportError:
    TEST_TENSORBOARD = False

TEST_MATPLOTLIB = True
try:
    import matplotlib
    if os.environ.get('DISPLAY', '') == '':
        matplotlib.use('Agg')
    import matplotlib.pyplot as plt
except ImportError:
    TEST_MATPLOTLIB = False
skipIfNoMatplotlib = unittest.skipIf(not TEST_MATPLOTLIB, "no matplotlib")

I don’t know how to use these tests, any help?