mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-03 12:50:06 +06:00
compatibility PT 1.0 and 0.4.1
This commit is contained in:
parent
13bf0d4659
commit
85fff78c2d
@ -32,7 +32,7 @@ class OptimizationTest(unittest.TestCase):
|
||||
def test_adam(self):
|
||||
w = torch.tensor([0.1, -0.2, -0.1], requires_grad=True)
|
||||
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
|
||||
optimizer = BertAdam(params=[w], lr=2e-1,
|
||||
weight_decay=0.0,
|
||||
|
Loading…
Reference in New Issue
Block a user