Skip to content

Update sbiutils.py to use one-dimensional batch - #1577

Merged
janfb merged 1 commit into
sbi-dev:mainfrom
vivienr:patch-1
Apr 24, 2025
Merged

janfb merged 1 commit into
sbi-dev:mainfrom
vivienr:patch-1

Conversation

@vivienr

@vivienr vivienr commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

This may be my mistake, but it seems the original:

len(batch_t > 1):

will always evaluate to True (unless batch_t has only one data point), even if there's only one batch. To use standardizing_net() as intended to load a pre-trained net with a dummy single-batch data, shouldn't it be:

len(batch_t) > 1:

Thanks !

This may be my mistake, but it seems the original:
```
len(batch_t > 1):
```
will always evaluate to True (unless batch_t has only one data point), even if there's only one batch. To use `standardizing_net()` as intended to load a pre-trained net with a dummy single-batch data, shouldn't it be:
```
len(batch_t) > 1:
```
Thanks !

@janfb janfb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks for fixing this 🙏

@codecov

codecov Bot commented Apr 24, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.91%. Comparing base (3e845bd) to head (72d5adf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1577      +/-   ##
==========================================
- Coverage   86.02%   78.91%   -7.12%     
==========================================
  Files         135      135              
  Lines       10754    10754              
==========================================
- Hits         9251     8486     -765     
- Misses       1503     2268     +765     
Flag Coverage Δ
unittests 78.91% <100.00%> (-7.12%) ⬇️

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

Files with missing lines Coverage Δ
sbi/utils/sbiutils.py 78.46% <100.00%> (-8.40%) ⬇️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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