-
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
Funsor function that can accept varied number of Bound variables #485
Labels
Comments
This is not (yet) possible with the current implementation of A minimal solution would be to define a BoundSet = typing.FrozenSet[Bound] and hard-code support for @make_funsor
def Mean(
X: Funsor,
axes: BoundSet
) -> Fresh[lambda X: X]:
return X.reduce(ops.add, axes) / reduce(ops.mul, [ax.output.size for ax in axes]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mean
,var
, andstandardize
functions in 3.1.6 Normalization layers accept multiple named axes (e.g., twobatch,layer
axes inBatchNorm
and onelayer
axis inLayerNorm
). How can I defineMean
andStandardize
below so that they can accept different number of bound variables?The text was updated successfully, but these errors were encountered: