Skip to content

Conversation

@Enderdead
Copy link
Contributor

This merge request introduces the create_diagonal delegate function (#100).

The implementation initially proposed in array-api-extra is only partially supported by third-party backends. A branching strategy has been introduced to rely on external implementations as much as possible.

Available for feedback !

@lucascolley lucascolley added enhancement New feature or request delegation labels Oct 28, 2025
@lucascolley lucascolley added this to the 0.9.1 milestone Oct 28, 2025
Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

just one comment, thanks @Enderdead !


if is_torch_namespace(xp):
return xp.diag_embed(
atleast_nd(x, ndim=1, xp=xp), offset=offset, dim1=-2, dim2=-1
Copy link
Member

Choose a reason for hiding this comment

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

why do we need to use atleast_nd here, after the check above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants