You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which at first glance looks fine, since Apply is a generic type requiring the OpType which is bounded (subtype) of Op. At first, I thought it would be fine to just provide Apply[Op] here, but OptionalApplyType is only compatible with something like Apply[Any] and not Apply[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:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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