support broadcasting in _kl_categorical_categorical#10533
Closed
joh4n wants to merge 5 commits into
Closed
Conversation
Contributor
|
Could you please add a test in |
Contributor
Author
|
I added a basic test for it |
vishwakftw
reviewed
Aug 15, 2018
| (binomial30, binomial30), | ||
| (binomial_vectorized_count, binomial_vectorized_count), | ||
| (categorical, categorical), | ||
| (Categorical(torch.ones(1, 10)), Categorical(torch.ones(3, 10))), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
vishwakftw
approved these changes
Aug 15, 2018
Contributor
vishwakftw
left a comment
There was a problem hiding this comment.
LGTM. Thank you for fixing this.
soumith
approved these changes
Aug 15, 2018
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Support broadcasting in _kl_categorical_categorical this makes it possible to do: ``` import torch.distributions as dist import torch p_dist = dist.Categorical(torch.ones(1,10)) q_dist = dist.Categorical(torch.ones(100,10)) dist.kl_divergence(p_dist, q_dist) ``` Pull Request resolved: pytorch#10533 Differential Revision: D9341252 Pulled By: soumith fbshipit-source-id: 34575b30160b43b6c9e4c3070dd7ef07c00ff5d7
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.
Support broadcasting in _kl_categorical_categorical
this makes it possible to do: