([
        [255, 0, 0],
        [0, 255, 0],
        [0, 0, 255],
        [255, 0, 255],
    ], dtype=torch.int).unsqueeze(0)
    faces_tensor = torch.as_tensor([
        [0, 2, 3],
        [0, 3, 1],
        [0, 1, 2],
        [1, 3, 2],
    ], dtype=torch.int).unsqueeze(0)
    
    writer = SummaryWriter()
    writer.add_mesh('my_mesh', vertices=vertices_tensor, colors=colors_tensor, faces=faces_tensor)
    
    writer.close()
    

` add_hparams ` (  _hparam_dict=None_ , _metric_dict=None_ )  [ [source]
](_modules/torch/utils/tensorboard/writer.html#SummaryWriter.add_hparams) ¶

    

Add a set of hyperparameters to be compared in TensorBoard.

Parameters

    

  * **hparam_dict** ( [ _dict_ ](https://docs.python.org/3/library/stdtypes.html#dict "\(in Python v3.8\)") ) – Each key-value pair in the dictionary is the name of the hyper parameter and it’s corresponding value. 

  * **metric_dict** ( [ _dict_ ](https://docs.python.org/3/library/stdtypes.html#dict "\(in Python v3.8\)") ) – Each key-value pair in the dictionary is the name of the metric and it’s corresponding value. Note that the key used here should be unique in the tensorboard record. Otherwise the value you added by ` add_scalar  ` will be displayed in hparam plugin. In most cases, this is unwanted. 

Examples:

    
    
    from torch.utils.tensorboard import SummaryWriter
    with SummaryWriter() as w:
        for i in range(5):
            w.add_hparams({'lr': 0.1*i, 'bsize': i},
                          {'hparam/accuracy': 10*i, 'hparam/loss': 10*i})
    

Expected result:

[ ![_images/add_hparam.png](_images/add_hparam.png) ](_images/add_hparam.png)

` flush ` (  )  [ [source]
](_modules/torch/utils/tensorboard/writer.html#SummaryWriter.flush) ¶

    

Flushes the event file to disk. Call this method to make sure that all pending
events have been written to disk.

` close ` (  )  [ [source]
](_modules/torch/utils/tensorboard/writer.html#SummaryWriter.close) ¶

    

[ Next ![](_static/images/chevron-right-orange.svg) ](type_info.html "Type
Info") [ ![](_static/images/chevron-right-orange.svg) Previous
](model_zoo.html "torch.utils.model_zoo")

* * *

© Copyright 2019, Torch Contributors.

Built with [ Sphinx ](http://sphinx-doc.org/) using a [ theme
](https://github.com/rtfd/sphinx_rtd_theme) provided by [ Read the Docs
](https://readthedocs.org) .

  * torch.utils.tensorboard 

![](https://www.googleadservices.com/pagead/conversion/795629140/?label=txkmCPmdtosBENSssfsC&guid=ON&script=0)

##  Docs

Access comprehensive developer documentation for PyTorch

[ View Docs ](https://pytorch.org/docs/stable/index.html)

##  Tutorials

Get in-depth tutorials for beginners and advanced developers

[ View Tutorials ](https://pytorch.org/tutorials)

##  Resources

Find development resources and get your questions answered

[ View Resources ](https://pytorch.org/resources)

[ ](https://pytorch.org/)

  * [ PyTorch ](https://pytorch.org/)
  * [ Get Started ](https://pytorch.org/get-started)
  * [ Features ](https://pytorch.org/features)
  * [ Ecosystem ](https://pytorch.org/ecosystem)
  * [ Blog ](https://pytorch.org/blog/)
  * [ Contributing ](https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md)

  * [ Resources ](https://pytorch.org/resources)
  * [ Tutorials ](https://pytorch.org/tutorials)
  * [ Docs ](https://pytorch.org/docs/stable/index.html)
  * [ Discuss ](https://discuss.pytorch.org)
  * [ Github Issues ](https://github.com/pytorch/pytorch/issues)
  * [ Brand Guidelines ](https://pytorch.org/assets/brand-guidelines/PyTorch-Brand-Guidelines.pdf)

  * Stay Connected 
  * Email Address 

[ ](https://www.facebook.com/pytorch) [ ](https://twitter.com/pytorch) [
](https://www.youtube.com/pytorch)

To analyze traffic and optimize your experience, we serve cookies on this
site. By clicking or navigating, you agree to allow our usage of cookies. As
the current maintainers of this site, Facebook’s Cookies Policy applies. Learn
more, including about availa