Skip to content

"Unidirectionally broadcast the shapes" steps have issues #662

@huningxin

Description

@huningxin

The current unidirectionally broadcasting the shapes steps don't allow sizeA < sizeB according to the following step

If sizeB > sizeA, then return failure.

And the steps should pad shapeA, the current steps pad shapeB instead

Let paddedB be a clone of shapeB.
While paddedB’s size is less than sizeA, prepend 1 to paddedB.

This would cause the following examples to fail

  1. ShapeA [], ShapeB [3, 4, 5]
  2. shapeA [5], shapeB [3, 4, 5]

When creating the output shape, the steps should use dimB. The current step uses dimA:

Append dimA to outputShape.

This would produce incorrect output shape. For example, assume ShapeA [3, 1, 5], ShapeB [3, 4, 5], the output shape should be [3, 4, 5], the current steps produce [3, 1, 5].

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions