Skip to content

Commit c4f8283

Browse files
authored
Update test_nacl_loss.py
Introduce temporary value for same cases to reduce space. DCO Remediation Commit for bala93 <balamuralim.1993@gmail.com> I, bala93 <balamuralim.1993@gmail.com>, hereby add my Signed-off-by to this commit: 8fbec82 I, bala93 <balamuralim.1993@gmail.com>, hereby add my Signed-off-by to this commit: 7c121a0 I, bala93 <balamuralim.1993@gmail.com>, hereby add my Signed-off-by to this commit: dccde47 Signed-off-by: bala93 <balamuralim.1993@gmail.com>
1 parent 4462379 commit c4f8283

1 file changed

Lines changed: 12 additions & 32 deletions

File tree

tests/test_nacl_loss.py

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919

2020
from monai.losses import NACLLoss
2121

22-
TEST_CASES = [
23-
[
24-
{"classes": 3, "dim": 2},
25-
{
26-
"inputs": torch.tensor(
22+
inputs = torch.tensor(
2723
[
2824
[
2925
[
@@ -46,39 +42,23 @@
4642
],
4743
]
4844
]
49-
),
50-
"targets": torch.tensor([[[1, 1, 1, 1], [1, 1, 1, 0], [0, 0, 0, 0], [0, 0, 0, 0]]]),
45+
)
46+
targets = torch.tensor([[[1, 1, 1, 1], [1, 1, 1, 0], [0, 0, 0, 0], [0, 0, 0, 0]]]),
47+
48+
TEST_CASES = [
49+
[
50+
{"classes": 3, "dim": 2},
51+
{
52+
"inputs": inputs,
53+
"targets": targets,
5154
},
5255
1.1820,
5356
],
5457
[
5558
{"classes": 3, "dim": 2, "kernel_ops": "gaussian"},
5659
{
57-
"inputs": torch.tensor(
58-
[
59-
[
60-
[
61-
[0.1498, 0.1158, 0.3996, 0.3730],
62-
[0.2155, 0.1585, 0.8541, 0.8579],
63-
[0.6640, 0.2424, 0.0774, 0.0324],
64-
[0.0580, 0.2180, 0.3447, 0.8722],
65-
],
66-
[
67-
[0.3908, 0.9366, 0.1779, 0.1003],
68-
[0.9630, 0.6118, 0.4405, 0.7916],
69-
[0.5782, 0.9515, 0.4088, 0.3946],
70-
[0.7860, 0.3910, 0.0324, 0.9568],
71-
],
72-
[
73-
[0.0759, 0.0238, 0.5570, 0.1691],
74-
[0.2703, 0.7722, 0.1611, 0.6431],
75-
[0.8051, 0.6596, 0.4121, 0.1125],
76-
[0.5283, 0.6746, 0.5528, 0.7913],
77-
],
78-
]
79-
]
80-
),
81-
"targets": torch.tensor([[[1, 1, 1, 1], [1, 1, 1, 0], [0, 0, 0, 0], [0, 0, 0, 0]]]),
60+
"inputs": inputs,
61+
"targets": targets,
8262
},
8363
1.1850,
8464
],

0 commit comments

Comments
 (0)