Skip to content

Commit 8321471

Browse files
astojiljannxingyuan
authored andcommitted
Don't upload small tensors as uniforms to packed op programs (tensorflow#1429)
BUG Trivial: modify the check to prevent upload to uniform when texData.isPacked == true and program.usesPackedTextures == true.
1 parent eab626e commit 8321471

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/kernels/backend_webgl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,7 @@ export class MathBackendWebGL implements KernelBackend {
18401840
let texData = this.texData.get(input.dataId);
18411841

18421842
if (texData.texture == null) {
1843-
if (!(!texData.isPacked && program.usesPackedTextures) &&
1843+
if (!program.usesPackedTextures &&
18441844
util.sizeFromShape(input.shape) <=
18451845
ENV.get('WEBGL_SIZE_UPLOAD_UNIFORM')) {
18461846
// Upload small tensors that live on the CPU as uniforms, not as

0 commit comments

Comments
 (0)