Open
Conversation
added 12 commits
February 19, 2024 16:53
added 2 commits
March 27, 2024 01:31
ordabayevy
commented
Apr 9, 2024
| ] | ||
| if bind_named_dims: | ||
| result = result[bind_named_dims] | ||
| return result |
Member
Author
There was a problem hiding this comment.
Unit tests for distribution shapes for log_prob, mean, sample, rsample, entropy (fail when named and positional dims are mixed in the batch/event/sample shape; conflicting named dims)
Generalize named dim binding implementation.
Test transforms and support.
Shape inference.
| return vindex(self._tensor, args) | ||
|
|
||
|
|
||
| def index_select(input, dim, index): |
Member
Author
There was a problem hiding this comment.
Add type annotation. Move to contrib/named in the follow up PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Few notes about this PR
functorch.dimmesses uptorch.Tensora bit (e.g., thetorch.Tensor.splitmethod starts to fail). Therefore, I siloed thefunctorch.dimimport from the main Pyropyro/contrib/namedfrom doctest in order to avoid the import offunctorch.dimhasattr(self.dim, "is_bound")instead ofisinstance(self.dim, Dim)Trace_ELBOimplementation is actually similar toTraceGraph_ELBOwith dependency tracking with the goal of having a singleTrace_ELBOimplementation that will generalize toTraceEnum_ELBOand others.pyro.enable_validationneeds to be set toFalseto avoid validation errors caused byif value.all()methodDistributionarguments all need to be bound by named dim, otherwise broadcasting attempt of parameters by a distribution will lead to segmentation fault