Replies: 1 comment
-
Most of what you've mentioned has little to do with Aesara's type system doesn't have the same flexibility as Python (e.g. there is no As we've discussed before, there is a named Remember, there's still a legacy C backend that's used by default, so that needs to be appeased—i.e. if you want to use those "tuples" at that level, you'll need some generic If one only wants to make a user or even dev-level interface simpler, they should use their own For example, see my comments here and here about such an improved interface in AeHMC. In the end, there is a mild convenience to having Also, I don't see the outputs of your examples, so it's not clear exactly how/why all these things aren't working. |
Beta Was this translation helpful? Give feedback.
-
What I expect
I expect
ifelse
to work when I pass two arbitrarily nested python data structures that have identical structures, and whose leaves areTensorVariables
of identical shape and dtype.This would greatly facilitate the use of
aesara
for "complex" projects such asaehmc
.What I observe
It works with a tuple of
TensorVariable
An
IfElse
Op can be created passing a tuple or a list ofTensorVariable
s for each branch of the condition:It does not work with nested tuples
However, it does not work with nested structures. Here is a simplified version of something I have encountered in aehmc:
Which returns a
TypeError
.It does not work with dictionaries
In the same way, it will not work with dictionaries as input, the following also returns a
TypeError
:It does not work with namedtuples
IfElse
returns a tuple whenNamedTuple
s are passed an input, causing errors downstream.Beta Was this translation helpful? Give feedback.
All reactions