Skip to content

Commit

Permalink
Merge branch 'dev-3.x' of github.com:open-mmlab/mmdetection into ssod…
Browse files Browse the repository at this point in the history
…_tutorial
  • Loading branch information
Czm369 committed Aug 27, 2022
2 parents 7f0c66b + e405153 commit 63ca912
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/test_engine/test_hooks/test_mean_teacher_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def __init__(self):

def forward(self, inputs, data_samples, mode='tensor'):
labels = torch.stack(data_samples)
inputs = torch.stack(inputs)
outputs = self.linear(inputs)
if mode == 'tensor':
return outputs
Expand Down
5 changes: 3 additions & 2 deletions tests/test_engine/test_runner/test_loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self):

def forward(self, inputs, data_samples, mode='tensor'):
labels = torch.stack(data_samples)
inputs = torch.stack(inputs)
outputs = self.linear(inputs)
if mode == 'tensor':
return outputs
Expand Down Expand Up @@ -71,7 +72,7 @@ def __len__(self):
return self.data.size(0)

def __getitem__(self, index):
return dict(inputs=self.data[index], data_sample=self.label[index])
return dict(inputs=self.data[index], data_samples=self.label[index])


class TestTeacherStudentValLoop(TestCase):
Expand All @@ -82,7 +83,7 @@ def setUp(self):
def tearDown(self):
self.temp_dir.cleanup()

def test_mean_teacher_hook(self):
def test_teacher_student_val_loop(self):
device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
model = ToyModel2().to(device)
evaluator = Mock()
Expand Down

0 comments on commit 63ca912

Please sign in to comment.