torch.utils.tensorboard
Before going further, more details on TensorBoard can be found at
https://www.tensorflow.org/tensorboard/
Once you've installed TensorBoard, these utilities let you log PyTorch
models and metrics into a directory for visualization within the
TensorBoard UI. Scalars, images, histograms, graphs, and embedding
visualizations are all supported for PyTorch models and tensors as
well as Caffe2 nets and blobs.
The SummaryWriter class is your main entry to log data for consumption
and visualization by TensorBoard. For example:
import torch
   import torchvision
   from torch.utils.tensorboard import SummaryWriter
   from torchvision import datasets, transforms
# Writer will output to ./runs/ directory by default
   writer = SummaryWriter()
transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,))])
   trainset = datasets.MNIST('mnist_train', train=True, download=True, transform=transform)