pytorch/torch/utils/tensorboard
anjali411 ddff014b79 fixed scale_factor calculation for uint8 tensor (#31778)
Summary:
When calling the add_images() method on the tensorboard SummaryWriter with a uint8 NCHW tensor, the tensor is incorrectly scaled, resulting in overflow behavior. This leads to incorrect images being displayed in tensorboard.

Issue: https://github.com/pytorch/pytorch/issues/31459

Local Testing (ran this code with and without the PR changes and printed scale_factor):

import torch
import torchvision
from torch.utils.tensorboard import SummaryWriter

writer = SummaryWriter()
x=torch.tensor([[[[1, 2, 3], [4, 5, 6]]]], dtype=torch.uint8)
writer.add_images("images", x)

Before- scale_factor: 255, After- scale_factor: 1
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31778

Differential Revision: D19289189

Pulled By: anjali411

fbshipit-source-id: 350a1650337244deae4fd8f8b7fb0e354ae6986b
2020-01-06 10:27:35 -08:00
..
__init__.py
_caffe2_graph.py Cleanup API and remove 'experimental' warning (#23000) 2019-07-22 12:10:05 -07:00
_convert_np.py Remove hard Caffe2 dependency for TensorBoard (#24295) 2019-08-13 20:33:24 -07:00
_embedding.py Support logging tensorboard embedding visualizations to generic filesystem (#27716) 2019-10-22 08:12:25 -07:00
_onnx_graph.py Remove in-memory scalars and add comments (#20038) 2019-05-02 22:26:28 -07:00
_proto_graph.py
_pytorch_graph.py Fix for when PyTorch model trace has RecursiveScriptModules (#30430) 2019-11-26 06:53:35 -08:00
_utils.py fixed scale_factor calculation for uint8 tensor (#31778) 2020-01-06 10:27:35 -08:00
summary.py Fixing the calling parameters of write_gif function of the moviepy. 2019-09-23 06:53:24 -07:00
writer.py add_hparams() NoneType error (#30286) 2019-11-21 23:25:26 -08:00