Skip to content

Change shape handling to iid,batch,event - #1061

Merged
michaeldeistler merged 1 commit into
mainfrom
shaper2
Mar 20, 2024
Merged

michaeldeistler merged 1 commit into
mainfrom
shaper2

Conversation

@michaeldeistler

Copy link
Copy Markdown
Contributor

What does this implement/fix? Explain your changes

Following the conventions of pytorch, we are changing how shapes will be interpreted in sbi:

(iid, batch, event)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.

  • I have read and understood the contribution
    guidelines
  • I agree with re-licensing my contribution from AGPLv3 to Apache-2.0.
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have reported how long the new tests run and potentially marked them
    with pytest.mark.slow.
  • New and existing unit tests pass locally with my changes
  • I performed linting and formatting as described in the contribution
    guidelines
  • I rebased on main (or there are no conflicts with main)

@michaeldeistler
michaeldeistler requested a review from bkmi March 20, 2024 15:19

@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.

Great! Makes a lot of sense to switch to iid-batch-event convention 👍


@pytest.mark.parametrize(
"theta_or_x_shape, target_shape, event_shape, batch_is_iid",
"theta_or_x_shape, target_shape, event_shape, leading_is_iid",

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.

🚀

((2, 3, 5), (2, 1, 3, 5), (3, 5), True),
((1, 2, 3, 5), (1, 2, 3, 5), (3, 5), True),
((1, 2, 3, 5), (1, 2, 3, 5), (3, 5), False),
pytest.param((1, 2, 3, 5), (1, 2, 3, 5), (5), False, marks=pytest.mark.xfail),

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.

👍

@michaeldeistler
michaeldeistler merged commit db91f59 into main Mar 20, 2024
@michaeldeistler
michaeldeistler deleted the shaper2 branch March 20, 2024 16:28
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