Skip to content

Use similar promotion rules in trace() as sum() and prod() #493

Closed
@asmeurer

Description

@asmeurer

sum() and prod() use special promotion rules (see #202 and https://data-apis.org/array-api/latest/API_specification/generated/signatures.statistical_functions.sum.html#signatures.statistical_functions.sum). trace() is effectively a sum over the diagonal, so it should use the same rules. np.trace() currently already acts the same as np.sum() in this regard.

Presumably this also means we should add a dtype argument to trace()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions