diff --git a/tfjs-core/src/backends/webgl/backend_webgl.ts b/tfjs-core/src/backends/webgl/backend_webgl.ts index 9a35faf134f..6dc0e2475ec 100644 --- a/tfjs-core/src/backends/webgl/backend_webgl.ts +++ b/tfjs-core/src/backends/webgl/backend_webgl.ts @@ -487,9 +487,10 @@ export class MathBackendWebGL implements KernelBackend { // Download the values from the GPU. let vals: Float32Array; if (dtype === 'complex64') { - const ps = - Promise.all([complexTensors.real.data(), complexTensors.imag.data()]); - const [realValues, imagValues] = await ps; + const ps = await Promise.all( + [complexTensors.real.data(), complexTensors.imag.data()]); + const realValues = ps[0]; + const imagValues = ps[1]; vals = mergeRealAndImagArrays( realValues as Float32Array, imagValues as Float32Array); } else if (buffer == null) { diff --git a/tfjs-core/src/backends/webgl/conv_backprop_gpu_depthwise.ts b/tfjs-core/src/backends/webgl/conv_backprop_gpu_depthwise.ts index f5374cda70f..2e55f07a6a4 100644 --- a/tfjs-core/src/backends/webgl/conv_backprop_gpu_depthwise.ts +++ b/tfjs-core/src/backends/webgl/conv_backprop_gpu_depthwise.ts @@ -43,7 +43,7 @@ export class DepthwiseConv2DDerFilterProgram implements GPGPUProgram { float dotProd = 0.0; - // TODO: Vec4 over the batch size + // TO DO: Vec4 over the batch size for (int b = 0; b < ${convInfo.batchSize}; b++) { for (int yR = 0; yR < ${convInfo.outHeight}; yR++) { int xR = wR + yR * ${strideHeight} - ${padTop}; @@ -122,7 +122,7 @@ export class DepthwiseConv2DDerInputProgram implements GPGPUProgram { int wCPerm = ${filterWidth} - 1 - wC; - // TODO: Vec4 over the channelMul + // TO DO: Vec4 over the channelMul for (int dm = 0; dm < ${channelMul}; dm++) { int d2 = d1 * ${channelMul} + dm; float xValue = getDy(batch, idyR, idyC, d2); diff --git a/tfjs-core/src/backends/webgl/conv_gpu_depthwise.ts b/tfjs-core/src/backends/webgl/conv_gpu_depthwise.ts index 6e2bb9405bf..8a89c789b78 100644 --- a/tfjs-core/src/backends/webgl/conv_gpu_depthwise.ts +++ b/tfjs-core/src/backends/webgl/conv_gpu_depthwise.ts @@ -56,7 +56,7 @@ export class DepthwiseConv2DProgram implements GPGPUProgram { // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - // TODO(dsmilkov): Flatten the two for loops and vec4 the operations. + // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations. for (int wR = 0; wR < ${filterHeight}; wR++) { int xR = xRCorner + wR * ${dilationHeight}; diff --git a/tfjs-core/src/ops/browser.ts b/tfjs-core/src/ops/browser.ts index ef8bcc2ec08..58a084e75cd 100644 --- a/tfjs-core/src/ops/browser.ts +++ b/tfjs-core/src/ops/browser.ts @@ -97,8 +97,9 @@ export async function toPixels( const data = await $img.data(); const minTensor = $img.min(); const maxTensor = $img.max(); - const [minVals, maxVals] = - await Promise.all([minTensor.data(), maxTensor.data()]); + const vals = await Promise.all([minTensor.data(), maxTensor.data()]); + const minVals = vals[0]; + const maxVals = vals[1]; const min = minVals[0]; const max = maxVals[0]; minTensor.dispose();