Repository: pytorch
Issue: [Tensorboard] Problem with subfolders from SummaryWriter
Labels: triaged,module: tensorboard

## Bug

Using the `add_scalars` or the `add_hparams` methods from the `SummaryWriter` in `torch.utils.tensorboard` results in a folder structure with subfolders that each contain further "tfevents" files. As a result, Tensorboard loads them as separate runs which very quickly leads to chaos when trying to distinguish different training sessions:

![Tensorboard](https://user-images.githubusercontent.com/16224924/73186483-17aa0a00-4120-11ea-924c-0335d914f87f.png)



## To Reproduce

The following code creates the problematic folder structure:
`from torch.utils.tensorboard import SummaryWriter`
`writer = SummaryWriter('runs/experiment1')`
`writer.add_hparams({"lr": 0.001, "batch": 10}, {"metric/distance": 0.5})`
`writer.add_scalar("training/loss", 0.783, 1)`
`writer.add_scalar("training/loss", 0.837, 2)`
`writer.add_scalar("training/loss", 0.642, 3)`
`writer.add_scalars("training/accuracy", {"A":0.1, "B":0.2, "C":0.3}, 1)`
`writer.add_scalars("training/accuracy", {"A":0.2, "B":0.3, "C":0.4}, 2)`
`writer.add_scalars("training/accuracy", {"A":0.3, "B":0.4, "C":0.5}, 3)`
`writer.close()`

The resulting files and folders are:
runs/experiment1/1580137040.107033/events.out.tfevents.1580137040.cube1.26313.1
runs/experiment1/training_accuracy_A/events.out.tfevents.1580137040.cube1.26313.2
runs/experiment1/training_accuracy_B/events.out.tfevents.1580137040.cube1.26313.3
runs/experiment1/training_accuracy_C/events.out.tfevents.1580137040.cube1.26313.4
runs/experiment1/events.out.tfevents.1580137040.cube1.26313.0


## Expected behavior

Tensorboard should only show one run containing all data provided to a single `SummaryWriter`. This could be done by always writing to the same "tfevents" file or maybe there is a workaround to prevent tensorboard from recursively searching the runs folder?


## Environment

PyTorch version: 1.3.1
Is debug build: No
CUDA used to build PyTorch: 9.2.148

OS: Ubuntu 16.04.5 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
CMake version: version 3.5.1

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 9.0.176
GPU models and configuration: 
GPU 0: GeForce GTX 1080 Ti

Nvidia driver version: 410.79
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.5.1.10
/usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7

Versions of relevant libraries:
[pip] numpy==1.15.4
[pip] torch==1.3.1
[pip] torchvision==0.4.2
[conda] _tflow_select             2.3.0                       mkl  
[conda] blas                      1.0                         mkl  
[conda] cuda90                    1.0                  h6433d27_0    pytorch
[conda] mkl                       2018.0.3                      1  
[conda] mkl_fft                   1.0.6            py37h7dd41cf_0  
[conda] mkl_random                1.0.1            py37h4414c95_1  
[conda] pytorch                   1.3.1           py3.7_cuda9.2.148_cudnn7.6.3_0    pytorch
[conda] tensorflow                1.14.0          mkl_py37h45c423b_0  
[conda] tensorflow-base           1.14.0          mkl_py37h7ce6ba3_0  
[conda] torchvision               0.4.2                 py37_cu92    pytorch