Fix shallow slice bugs: dtype and mem leak#1577
Conversation
annxingyuan
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 1 approvals obtained (waiting on @annxingyuan and @dsmilkov)
src/ops/slice_test.ts, line 511 at r1 (raw file):
describeWithFlags('shallow slice an input that was cast', ALL_ENVS, () => { beforeAll(() => { tf.ENV.set('WEBGL_CPU_FORWARD', false);
Do we need to set this, since jasmine_util.ts specifies WEBGL_CPU_FORWARD to be false for both webgl test environments?
dsmilkov
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 1 approvals obtained (waiting on @annxingyuan)
src/ops/slice_test.ts, line 511 at r1 (raw file):
Previously, annxingyuan (Ann Yuan) wrote…
Do we need to set this, since
jasmine_util.tsspecifiesWEBGL_CPU_FORWARDto be false for both webgl test environments?
It's good to set it since it makes the test hermetic (agnostic of what jasmine_util decides). It's also a signal for the reader that to reproduce this problem with casting, you have to not forward to cpu.
When doing shallow slicing:
dtypeassociated with the tex data can get out of sync with thedtypeof the sliced tensor.Also fix the chain API for unstack.
Fixes tensorflow/tfjs#1257
Also partially tensorflow/tfjs#569 (fixes Coco-SSD when using tfjs-core 0.15.x once this is cherry-picked)
This change is