From cc42c66f1e41bbea49f36d667dc5ca2d1c97ce31 Mon Sep 17 00:00:00 2001 From: Christoph Lehner Date: Tue, 31 Oct 2023 17:59:12 +0100 Subject: [PATCH] cleanup --- tests/ad/ad.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/ad/ad.py b/tests/ad/ad.py index 22531064..974fd87a 100755 --- a/tests/ad/ad.py +++ b/tests/ad/ad.py @@ -42,11 +42,7 @@ eps = prec.eps**0.5 g.message(f"Numerical derivatives with eps = {eps}") for var in [a1, a2, b1, b2, x, t1]: - if isinstance(var.value, g.lattice): - lt = g.lattice(var.value) - else: - lt = var.value.copy() - rng.cnormal(lt) + lt = rng.cnormal(var.value.new()) var.value += lt * eps v1 = c(with_gradients=False) var.value -= 2 * lt * eps