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 diagonal operator mapping base operator over an array axis #521

Merged
merged 13 commits into from
Jun 25, 2024

Conversation

bwohlberg
Copy link
Collaborator

@bwohlberg bwohlberg commented May 16, 2024

Add diagonal operator mapping base operator over an array axis via jax.pmap or jax.vmap.

Resolves #413.

@bwohlberg bwohlberg added the enhancement New feature or request label May 16, 2024
@@ -146,6 +147,83 @@ def _adj(self, y: Union[Array, BlockArray]) -> Union[Array, BlockArray]: # type
return snp.blockarray(result)


class DiagonalReplicated(DReplicated, LinearOperator):
Copy link
Contributor

Choose a reason for hiding this comment

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

It takes a second to figure out what DReplicated is here. Consider DiagonalReplicatedOperator?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I assume you noticed that this is an alias for operator.DiagonalReplicated. You don't have similar concerns for DStack and VStack? If DReplicated is changed as suggested, it would seem to make sense to modify them too for consistency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed as discussed.

@bwohlberg bwohlberg merged commit c06bdb5 into main Jun 25, 2024
18 checks passed
@bwohlberg bwohlberg deleted the brendt/pmap-linop branch June 25, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Construct a linop that implements a stacked version of another linop
3 participants