Replies: 2 comments 1 reply
-
Can't you do |
Beta Was this translation helpful? Give feedback.
1 reply
-
Re:
I don't know. The point is that a Variable can have an owner (an Apply[Op]) or no owner (None). Not sure we are doing something wrong? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
consider the above (which
mypy
is happy with). From what I see inpytensor
code,which at first glance looks fine, since
Apply
is a generic type requiring theOpType
which is bounded (subtype) ofOp
. At first, I thought it would be fine to just provideApply[Op]
here, butOptionalApplyType
is only compatible with something likeApply[Any]
and notApply[Op]
:so it's not clear if I'm treating this wrong or if there's a bug in the code for the typehints here. The main reason I'm defining this
TensorVar
type, is because I'm building a dictionary mapping names to expressions like this:as an example.
Beta Was this translation helpful? Give feedback.
All reactions