Advertisement
Guest User

Untitled

a guest
Apr 18th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.        acc
  7.            (recur (conj acc (apply tens-fill x (rest dims)) (- k 1)))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement