View difference between Paste ID: qDLmivBz and 3PY4tJrG
SHOW: | | - or go back to the newest paste.
1-
(defn vec-fill [x & dims]
1+
; produces a multidimensional tensor based on dimensions supplied
2
(defn tens-fill [x & dims]
3
  (if (empty? dims) x
4
    (loop [acc [] k (first dims)]
5
       (if (= 0 k) 
6-
           (recur (conj acc (apply vec-fill x (rest dims)) (- k 1)))))))
6+
7
           (recur (conj acc (apply tens-fill x (rest dims)) (- k 1)))))))