Skip to content
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

Add repr to TruncatedDiagonalMVN class #886

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Add repr to TruncatedDiagonalMVN class #886

merged 1 commit into from
Jul 20, 2023

Conversation

aakashdp6548
Copy link
Collaborator

torch.Distribution doesn't have a default __repr__ apparently, so trying to print TruncatedDiagonalMVN fails with NotImplementedError. This PR just adds a simple __repr__ that prints it similar to what it used to be before:

>>> print(pred["loc"])
TruncatedDiagonalMVN(Normal(loc: torch.Size([1, 18, 18, 2]), scale: torch.Size([1, 18, 18, 2])))

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #886 (5f9dd85) into master (4d829b3) will decrease coverage by 0.05%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #886      +/-   ##
==========================================
- Coverage   95.58%   95.54%   -0.05%     
==========================================
  Files          21       21              
  Lines        2264     2266       +2     
==========================================
+ Hits         2164     2165       +1     
- Misses        100      101       +1     
Flag Coverage Δ
unittests 95.54% <50.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
bliss/unconstrained_dists.py 87.30% <50.00%> (-1.23%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jeff-regier jeff-regier merged commit f14e8df into master Jul 20, 2023
3 checks passed
@jeff-regier jeff-regier deleted the loc-dist-repr branch July 20, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants