"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "db8bf336fcea590d2a75d2799b739cda6c0fc822"
Commit 85fff78c authored by thomwolf's avatar thomwolf
Browse files

compatibility PT 1.0 and 0.4.1

parent 13bf0d46
...@@ -32,7 +32,7 @@ class OptimizationTest(unittest.TestCase): ...@@ -32,7 +32,7 @@ class OptimizationTest(unittest.TestCase):
def test_adam(self): def test_adam(self):
w = torch.tensor([0.1, -0.2, -0.1], requires_grad=True) w = torch.tensor([0.1, -0.2, -0.1], requires_grad=True)
target = torch.tensor([0.4, 0.2, -0.5]) target = torch.tensor([0.4, 0.2, -0.5])
criterion = torch.nn.MSELoss(reduction='elementwise_mean') criterion = torch.nn.MSELoss()
# No warmup, constant schedule, no gradient clipping # No warmup, constant schedule, no gradient clipping
optimizer = BertAdam(params=[w], lr=2e-1, optimizer = BertAdam(params=[w], lr=2e-1,
weight_decay=0.0, weight_decay=0.0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment