Skip to content

Commit

Permalink
fix the not-inclusive-enough isinstance checks in logging.py (#5)
Browse files Browse the repository at this point in the history
Co-authored-by: RolandBERTINJOHANNET <roland.bertin-johannet@etu.umontpellier.fr>
  • Loading branch information
RolandBERTINJOHANNET and RolandBERTINJOHANNET authored Mar 21, 2024
1 parent a58a839 commit d29d428
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions simple_shapes_dataset/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
from matplotlib import gridspec
from matplotlib.figure import Figure
from PIL import Image
from shimmer.modules.global_workspace import (
GlobalWorkspace,
GlobalWorkspaceBase,
GlobalWorkspaceWithUncertainty,
)
from shimmer.modules.global_workspace import GlobalWorkspaceBase
from torchvision.utils import make_grid

from simple_shapes_dataset import LOGGER
Expand Down Expand Up @@ -430,7 +426,7 @@ def on_train_epoch_end(
if self.mode != "train":
return

if not isinstance(pl_module, (GlobalWorkspace, GlobalWorkspaceWithUncertainty)):
if not isinstance(pl_module, GlobalWorkspaceBase):
return

if (
Expand All @@ -449,7 +445,7 @@ def on_validation_epoch_end(
if self.mode != "val":
return

if not isinstance(pl_module, (GlobalWorkspace, GlobalWorkspaceWithUncertainty)):
if not isinstance(pl_module, GlobalWorkspaceBase):
return

if (
Expand All @@ -468,7 +464,7 @@ def on_test_epoch_end(
if self.mode != "test":
return

if not isinstance(pl_module, (GlobalWorkspace, GlobalWorkspaceWithUncertainty)):
if not isinstance(pl_module, GlobalWorkspaceBase):
return

return self.on_callback(trainer.current_epoch, trainer.loggers, pl_module)
Expand All @@ -481,7 +477,7 @@ def on_fit_end(
if self.mode == "test":
return

if not isinstance(pl_module, (GlobalWorkspace, GlobalWorkspaceWithUncertainty)):
if not isinstance(pl_module, GlobalWorkspaceBase):
return

return self.on_callback(trainer.current_epoch, trainer.loggers, pl_module)
Expand Down

0 comments on commit d29d428

Please sign in to comment.