Skip to content

Commit

Permalink
🔥 Remove torch.compile test for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdol A committed Oct 6, 2023
1 parent cdaade2 commit f302edb
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions tests/test_wsi_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import numpy as np
import pytest

from tests.conftest import timed
from tiatoolbox import logger
from tiatoolbox.tools.registration.wsi_registration import (
AffineWSITransformer,
DFBRegister,
Expand All @@ -23,28 +21,6 @@
RNG = np.random.default_rng() # Numpy Random Generator


def test_extract_features_time(dfbr_features: Path, test_count: int = 10) -> None:
"""Compute time test for CNN based feature extraction function."""
compile_time = 0.0
eager_compile_time = 0.0
for _ in range(test_count):
_, _compile_time = timed(lambda: test_extract_features(dfbr_features), compiled=True)
compile_time += _compile_time
for _ in range(test_count):
_, _compile_time = timed(
lambda: test_extract_features(dfbr_features, compiled=False),
)
eager_compile_time += _compile_time
compile_time /= test_count
eager_compile_time /= test_count
logger.info("Time taken for feature extraction (torch.compile): %f", compile_time)
logger.info(
"Time taken for feature extraction (eager execution): %f",
eager_compile_time,
)
assert compile_time < eager_compile_time


def test_extract_features(dfbr_features: Path, *, compiled: bool = True) -> None:
"""Test for CNN based feature extraction function."""
# dfbr (deep feature based registration).
Expand Down

0 comments on commit f302edb

Please sign in to comment.