mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
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 |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _caffe2_graph.py | ||
| _convert_np.py | ||
| _embedding.py | ||
| _onnx_graph.py | ||
| _proto_graph.py | ||
| _pytorch_graph.py | ||
| _utils.py | ||
| summary.py | ||
| writer.py | ||