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
- ShapeA
[], ShapeB [3, 4, 5]
- 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].
The current unidirectionally broadcasting the shapes steps don't allow
sizeA<sizeBaccording to the following stepAnd the steps should pad
shapeA, the current steps padshapeBinsteadThis would cause the following examples to fail
[], ShapeB[3, 4, 5][5], shapeB[3, 4, 5]When creating the output shape, the steps should use
dimB. The current step usesdimA: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].