Thanks for the example.
For me it got an AssertionError
AssertionError: size of input tensor and input format are different.         tensor shape: (1, 432, 288, 3), input_format: CHW

I ended up using writer.add_figure() which is much more concise