-
Notifications
You must be signed in to change notification settings - Fork 955
Fix squeeze and concat when all tensors are 0 sized #1199
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 8 files at r1.
Reviewable status: 0 of 1 approvals obtained (waiting on @dsmilkov, @nsthorat, and @pyu10055)
src/tensor_test.ts, line 945 at r1 (raw file):
const a = tf.tensor3d([], [0, 1, 0]); const res = tf.squeeze(a); expect(res.shape).toEqual([0, 0]);
this is so weird lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 8 files at r1.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @dsmilkov and @pyu10055)
src/ops/concat_util.ts, line 42 at r1 (raw file):
export function computeOutShape(shapes: number[][], axis: number): number[] { const outputShape = shapes[0].slice();
do you need to make sure the shapes have the same rank?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @dsmilkov)
src/tensor_test.ts, line 945 at r1 (raw file):
Previously, nsthorat (Nikhil Thorat) wrote…
this is so weird lol
I know.. but caused exception on coco_ssd model, so we have to fix it :)
src/ops/concat_util.ts, line 42 at r1 (raw file):
Previously, pyu10055 (Ping Yu) wrote…
do you need to make sure the shapes have the same rank?
The check I removed was redundant since the assertParams()
method above does the validation, which we call before we call this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 1 approvals obtained
Both changes are motivated by bugs showing up on ssd_mobilenet_v2_coco
BUG
This change is