Skip to content

Array math broadcastability #74

@toqduj

Description

@toqduj

In the DAWN implementation, it was possible to do array maths with arrays of non-equal dimensions, where arrays would be padded with extra dimensions on the right. For example: if we do A * B, with A shape (16, 1) and B of shape (16, 1, 1030, 1064), A would be padded to (16,1,1,1) before operation.

According to @timsnow, the broadcasting rules were module-dependent, usually more complex, and caused some difficult-to-trace issues. We're therefore proposing to not pad left or right, but instead demand from the user / data source that the arrays on which maths is supposed to be done are broadcastable in numpy operations. That means sanitising input rather than quietly adapting shapes.

Opinions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationhelp wantedExtra attention is neededquestionFurther information is requestedreview requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions