-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Does the constant field of a Node only come into play for leaf nodes?
It seems nondeterministic for branch nodes when playing around with it in the REPL.
julia> using DynamicExpressions
operators = OperatorEnum(1 => (inv,), 2 => (+,))
t1 = Node{Float64}(feature=1) + Node{Float64}(feature=2)
t1.constant
false
julia> using DynamicExpressions
operators = OperatorEnum(1 => (inv,), 2 => (+,))
t1 = Node{Float64}(feature=1) + Node{Float64}(feature=2)
t1.constant
false
julia> t2 = Node{Float64}(op=0x1, children=(Node{Float64}(feature=1), Node{Float64}(feature=2)))
t2.constant
true
julia> using DynamicExpressions
operators = OperatorEnum(1 => (inv,), 2 => (+,))
t1 = Node{Float64}(feature=1) + Node{Float64}(feature=2)
t1.constant
false
julia> t2 = Node{Float64}(op=0x1, children=(Node{Float64}(feature=1), Node{Float64}(feature=2)))
t2.constant
falseIs the correct deterministic way for determining if a node is operator/constant/feature, to use has_operators and then has_constants?
Metadata
Metadata
Assignees
Labels
No labels