7474function prepare_derivative (
7575 f:: F , backend:: AbstractADType , x, contexts:: Vararg{Context,C}
7676) where {F,C}
77- pushforward_prep = prepare_pushforward (f, backend, x, (one (x),), contexts... )
77+ pushforward_prep = prepare_pushforward (f, backend, x, (realone (x),), contexts... )
7878 return PushforwardDerivativePrep (pushforward_prep)
7979end
8080
8181function prepare_derivative (
8282 f!:: F , y, backend:: AbstractADType , x, contexts:: Vararg{Context,C}
8383) where {F,C}
84- pushforward_prep = prepare_pushforward (f!, y, backend, x, (one (x),), contexts... )
84+ pushforward_prep = prepare_pushforward (f!, y, backend, x, (realone (x),), contexts... )
8585 return PushforwardDerivativePrep (pushforward_prep)
8686end
8787
@@ -95,7 +95,7 @@ function value_and_derivative(
9595 contexts:: Vararg{Context,C} ,
9696) where {F,C}
9797 y, ty = value_and_pushforward (
98- f, prep. pushforward_prep, backend, x, (one (x),), contexts...
98+ f, prep. pushforward_prep, backend, x, (realone (x),), contexts...
9999 )
100100 return y, only (ty)
101101end
@@ -109,7 +109,7 @@ function value_and_derivative!(
109109 contexts:: Vararg{Context,C} ,
110110) where {F,C}
111111 y, _ = value_and_pushforward! (
112- f, (der,), prep. pushforward_prep, backend, x, (one (x),), contexts...
112+ f, (der,), prep. pushforward_prep, backend, x, (realone (x),), contexts...
113113 )
114114 return y, der
115115end
@@ -121,7 +121,7 @@ function derivative(
121121 x,
122122 contexts:: Vararg{Context,C} ,
123123) where {F,C}
124- ty = pushforward (f, prep. pushforward_prep, backend, x, (one (x),), contexts... )
124+ ty = pushforward (f, prep. pushforward_prep, backend, x, (realone (x),), contexts... )
125125 return only (ty)
126126end
127127
@@ -133,7 +133,7 @@ function derivative!(
133133 x,
134134 contexts:: Vararg{Context,C} ,
135135) where {F,C}
136- pushforward! (f, (der,), prep. pushforward_prep, backend, x, (one (x),), contexts... )
136+ pushforward! (f, (der,), prep. pushforward_prep, backend, x, (realone (x),), contexts... )
137137 return der
138138end
139139
@@ -148,7 +148,7 @@ function value_and_derivative(
148148 contexts:: Vararg{Context,C} ,
149149) where {F,C}
150150 y, ty = value_and_pushforward (
151- f!, y, prep. pushforward_prep, backend, x, (one (x),), contexts...
151+ f!, y, prep. pushforward_prep, backend, x, (realone (x),), contexts...
152152 )
153153 return y, only (ty)
154154end
@@ -163,7 +163,7 @@ function value_and_derivative!(
163163 contexts:: Vararg{Context,C} ,
164164) where {F,C}
165165 y, _ = value_and_pushforward! (
166- f!, y, (der,), prep. pushforward_prep, backend, x, (one (x),), contexts...
166+ f!, y, (der,), prep. pushforward_prep, backend, x, (realone (x),), contexts...
167167 )
168168 return y, der
169169end
@@ -176,7 +176,7 @@ function derivative(
176176 x,
177177 contexts:: Vararg{Context,C} ,
178178) where {F,C}
179- ty = pushforward (f!, y, prep. pushforward_prep, backend, x, (one (x),), contexts... )
179+ ty = pushforward (f!, y, prep. pushforward_prep, backend, x, (realone (x),), contexts... )
180180 return only (ty)
181181end
182182
@@ -189,7 +189,9 @@ function derivative!(
189189 x,
190190 contexts:: Vararg{Context,C} ,
191191) where {F,C}
192- pushforward! (f!, y, (der,), prep. pushforward_prep, backend, x, (one (x),), contexts... )
192+ pushforward! (
193+ f!, y, (der,), prep. pushforward_prep, backend, x, (realone (x),), contexts...
194+ )
193195 return der
194196end
195197
0 commit comments