Skip to content

Commit

Permalink
Add test case to model transform tests (#1795)
Browse files Browse the repository at this point in the history
add test case
  • Loading branch information
djdameln authored Feb 29, 2024
1 parent 2e99ecd commit 83b53d8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit/engine/test_setup_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,12 @@ def test_precendence_datamodule(self, checkpoint_path: Path) -> None:
model = DummyModel()
Engine._setup_transform(model, ckpt_path=checkpoint_path, datamodule=datamodule) # noqa: SLF001
assert model.transform == transform

def test_transform_already_assigned(self) -> None:
"""Tests if the transform from the model is used when the model already has a transform assigned."""
transform = Transform()
model = DummyModel()
model.set_transform(transform)
datamodule = DummyDataModule()
Engine._setup_transform(model, datamodule=datamodule) # noqa: SLF001
assert model.transform == transform

0 comments on commit 83b53d8

Please sign in to comment.