Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case to model transform tests #1795

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading