Skip to content

broadcast_shapes turns a 0 dimension into 1 #2015

Open

Description

@SashaMIT

broadcast_shapes([(0,), (1,)]) returns (1,). NumPy returns (0,). broadcast_shapes([(5, 1), (1, 0)]) returns (5, 1). NumPy returns (5, 0). broadcast_shapes([(1, 0), (0, 1)]) returns (1, 1). NumPy returns (0, 0).

The function follows NumPy, and wp.map uses this shape for the output array. When one size is 1, the result is max of the two sizes, so 0 loses to 1. broadcast_shapes([(3, 1, 4), (5, 4)]) is still (3, 5, 4).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions