From 505513b2e27bdd95f693fab8eb941699045cf0ab Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 6 Nov 2023 11:42:54 +0900 Subject: [PATCH] Take instead of reverse drop --- grad.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grad.scm b/grad.scm index 315f4c0..5e1ea7f 100644 --- a/grad.scm +++ b/grad.scm @@ -30,9 +30,9 @@ (if (or (> n (array-rank a)) (> n (array-rank b))) (error "can't contract arrays with size lower than" n) - (append (reverse (drop (reverse dims-a) - n)) - (drop dims-b n))))) + (append (take dims-a (- (array-rank a) + n)) + (drop dims-b n))))) (define (contract-arrays a b n) (let* ((dims (contracted-dims a b n)) -- 2.39.5