MCPcopy Index your code
hub / github.com/huggingface/diffusers / get_model_optimizer

Method get_model_optimizer

tests/others/test_training.py:30–34  ·  view source on GitHub ↗
(self, resolution=32)

Source from the content-addressed store, hash-verified

28
29class TrainingTests(unittest.TestCase):
30 def get_model_optimizer(self, resolution=32):
31 set_seed(0)
32 model = UNet2DModel(sample_size=resolution, in_channels=3, out_channels=3)
33 optimizer = torch.optim.SGD(model.parameters(), lr=0.0001)
34 return model, optimizer
35
36 @slow
37 def test_training_step_equality(self):

Callers 1

Calls 3

set_seedFunction · 0.90
UNet2DModelClass · 0.90
parametersMethod · 0.80

Tested by

no test coverage detected