diff --git a/src/emmy/dual.cljc b/src/emmy/dual.cljc index 16d799dc..2e352910 100644 --- a/src/emmy/dual.cljc +++ b/src/emmy/dual.cljc @@ -554,7 +554,9 @@ ([primal tag] (bundle-element primal 1 tag)) ([primal tangent tag] - {:pre [(v/scalar? primal)]} + {:pre [(or (v/scalar? primal) + ;; TODO + (isa? (v/kind primal) ::v/function))]} (if (g/zero? tangent) primal (->Dual tag primal tangent)))) diff --git a/src/emmy/tape.cljc b/src/emmy/tape.cljc index 3f6e281c..78d9384a 100644 --- a/src/emmy/tape.cljc +++ b/src/emmy/tape.cljc @@ -235,10 +235,9 @@ all leaves recursively replaced by [[TapeCell]] instances." [x tag] (cond - (v/scalar? x) (make tag x) + (or (v/scalar? x) (f/function? x)) (make tag x) (s/structure? x) (s/mapr #(tapify % tag) x) - (f/function? x) (u/illegal "Function input not yet supported.") - :else x)) + :else x)) ;; ### Accessors