Skip to content

Commit 141e4b9

Browse files
committed
Refactored
1 parent c049cd7 commit 141e4b9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_torch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
def setup_function(fn):
1212
print("torch version:", torch.__version__, "torchvision version:", torchvision.__version__)
1313

14+
1415
def test_cov():
1516
x = np.random.randn(10, 10)
1617
cov_np = np.cov(x)
1718
cov_t = torchstain.torch.utils.cov(torch.tensor(x))
1819

1920
np.testing.assert_almost_equal(cov_np, cov_t.numpy())
2021

22+
2123
def test_percentile():
2224
x = np.random.randn(10, 10)
2325
p = 20
@@ -26,6 +28,7 @@ def test_percentile():
2628

2729
np.testing.assert_almost_equal(p_np, p_t)
2830

31+
2932
def test_macenko_torch():
3033
size = 1024
3134
curr_file_path = os.path.dirname(os.path.realpath(__file__))
@@ -57,6 +60,7 @@ def test_macenko_torch():
5760
# assess whether the normalized images are identical across backends
5861
np.testing.assert_almost_equal(result_numpy.flatten(), result_torch.flatten(), decimal=2, verbose=True)
5962

63+
6064
def test_multitarget_macenko_torch():
6165
size = 1024
6266
curr_file_path = os.path.dirname(os.path.realpath(__file__))

0 commit comments

Comments
 (0)