Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkovsky committed Jun 7, 2023
1 parent bc07782 commit d4f8381
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_fedbiosklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ def testing_step(mydata, mytarget):
return {'Metric': 42.0}


class FakeTrainingArgs:
class FakeTrainingArgs(dict):
"""Mimics TrainingArgs class
"""
def __init__(self):
self['random_seed'] = 42

def optimizer_arguments(self):
return {'lr': 1e-2}

Expand Down
2 changes: 2 additions & 0 deletions tests/test_torchnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class TestTorchnn(unittest.TestCase):
optimizer = NativeTorchOptimizer(model, Adam([torch.zeros([2, 4])]))

class FakeTrainingArgs(dict):
def __init__(self):
self['random_seed'] = 42

def pure_training_arguments(self):
return {"dry_run": True, "epochs": 1, "batch_size": 10, "log_interval": 10}
Expand Down

0 comments on commit d4f8381

Please sign in to comment.