Skip to content

Commit 8c087a4

Browse files
[WebGPU] Access properties with .prop instead of ['prop'] (#8503)
Fixes a bug with closure compiler property renaming.
1 parent 29c5db3 commit 8c087a4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tfjs-backend-webgpu/src/backend_webgpu.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ const reshapeDispatch =
7373
program: webgpu_program.WebGPUProgram): [number, number, number] => {
7474
const MAX_COMPUTE_PER_DIMENSION_DISPATCH_SIZE =
7575
device.limits.maxComputeWorkgroupsPerDimension;
76-
const layout = program['dispatchLayout'];
77-
const dispatch = program['dispatch'];
76+
const layout = program.dispatchLayout;
77+
const dispatch = program.dispatch;
7878
if (dispatch.every((d) => d <= MAX_COMPUTE_PER_DIMENSION_DISPATCH_SIZE)) {
7979
return dispatch;
8080
}
@@ -694,8 +694,8 @@ export class WebGPUBackend extends KernelBackend {
694694
};
695695

696696
const kernelMs = await Promise.all(flattenedActiveTimerQueries);
697-
res['kernelMs'] = util.sum(kernelMs);
698-
res['getExtraProfileInfo'] = () =>
697+
res.kernelMs = util.sum(kernelMs);
698+
res.getExtraProfileInfo = () =>
699699
kernelMs.map((d, i) => ({name: flattenedActiveTimerNames[i], ms: d}))
700700
.map(d => `${d.name}: ${d.ms}`)
701701
.join(', ');

0 commit comments

Comments
 (0)