Skip to content

Commit 4b5759c

Browse files
committed
Formatting updates
Signed-off-by: Eric Kerfoot <[email protected]>
1 parent b26894e commit 4b5759c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

monai/data/meta_tensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,5 +609,6 @@ def print_verbose(self) -> None:
609609
print(self.meta.__repr__())
610610

611611

612-
if hasattr(torch.serialization,"add_safe_globals"):
612+
# needed in later versions of Pytorch to indicate the class is safe for serialisation
613+
if hasattr(torch.serialization, "add_safe_globals"):
613614
torch.serialization.add_safe_globals([MetaTensor])

monai/utils/jupyter_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def plot_engine_status(
234234

235235

236236
def _get_loss_from_output(
237-
output: list[torch.Tensor | dict[str, torch.Tensor]] | dict[str, torch.Tensor] | torch.Tensor
237+
output: list[torch.Tensor | dict[str, torch.Tensor]] | dict[str, torch.Tensor] | torch.Tensor,
238238
) -> torch.Tensor:
239239
"""Returns a single value from the network output, which is a dict or tensor."""
240240

monai/visualize/img2tensorboard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ def _image3_animated_gif(
6565
img_str = b""
6666
for b_data in PIL.GifImagePlugin.getheader(ims[0])[0]:
6767
img_str += b_data
68-
img_str += b"\x21\xFF\x0B\x4E\x45\x54\x53\x43\x41\x50" b"\x45\x32\x2E\x30\x03\x01\x00\x00\x00"
68+
img_str += b"\x21\xff\x0b\x4e\x45\x54\x53\x43\x41\x50" b"\x45\x32\x2e\x30\x03\x01\x00\x00\x00"
6969
for i in ims:
7070
for b_data in PIL.GifImagePlugin.getdata(i):
7171
img_str += b_data
72-
img_str += b"\x3B"
72+
img_str += b"\x3b"
7373

7474
summary = SummaryX if has_tensorboardx and isinstance(writer, SummaryWriterX) else Summary
7575
summary_image_str = summary.Image(height=10, width=10, colorspace=1, encoded_image_string=img_str)

0 commit comments

Comments
 (0)