-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the type hint of variables bound inside (e.g., ax
in Softmax)
#481
Labels
question
Further information is requested
Comments
You'll need @make_funsor
def Softmax(
x: Funsor,
ax: Bound,
ax2: Fresh[lambda ax: ax],
) -> Fresh[lambda x: x]:
x = x(**{ax: ax2}) # rename to work around alpha renaming limitations
y = x - x.reduce(ops.logaddexp, ax2)
return y.exp() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What should be the type hint for
ax
in thisSoftmax
function?Funsor
works but then thenax
cannot be astr
Value[str]
can only be astr
and notVariable
Bound
works both asstr
andVariable
butax
is not actually boundThe text was updated successfully, but these errors were encountered: