Skip to content

Commit 2469d8b

Browse files
committed
Fix multiple-dispatch for tree as function
1 parent 154dd34 commit 2469d8b

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/OperatorEnumConstruction.jl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,13 @@ function create_evaluation_helpers!(operators::OperatorEnum)
1111
@eval begin
1212
Base.print(io::IO, tree::Node) = print(io, string_tree(tree, $operators))
1313
Base.show(io::IO, tree::Node) = print(io, string_tree(tree, $operators))
14-
function (tree::Node{T})(
15-
X::AbstractArray{T,2}; kws...
16-
)::AbstractArray{T,1} where {T<:Real}
14+
function (tree::Node)(X; kws...)
1715
out, did_finish = eval_tree_array(tree, X, $operators; kws...)
1816
if !did_finish
1917
out .= convert(eltype(out), NaN)
2018
end
2119
return out
2220
end
23-
function (tree::Node{T1})(X::AbstractArray{T2,2}; kws...) where {T1<:Real,T2<:Real}
24-
if T1 != T2
25-
T = promote_type(T1, T2)
26-
tree = convert(Node{T}, tree)
27-
X = T.(X)
28-
end
29-
return tree(X; kws...)
30-
end
3121
# Gradients:
3222
function Base.adjoint(tree::Node{T}) where {T}
3323
return (X; kws...) -> begin

0 commit comments

Comments
 (0)