Skip to content

Commit

Permalink
Access properties with .prop instead of ['prop']
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsoulanille committed Jan 22, 2025
1 parent 2644bd0 commit 0ad028b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tfjs-backend-webgpu/src/backend_webgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ const reshapeDispatch =
program: webgpu_program.WebGPUProgram): [number, number, number] => {
const MAX_COMPUTE_PER_DIMENSION_DISPATCH_SIZE =
device.limits.maxComputeWorkgroupsPerDimension;
const layout = program['dispatchLayout'];
const dispatch = program['dispatch'];
const layout = program.dispatchLayout;
const dispatch = program.dispatch;
if (dispatch.every((d) => d <= MAX_COMPUTE_PER_DIMENSION_DISPATCH_SIZE)) {
return dispatch;
}
Expand Down Expand Up @@ -694,8 +694,8 @@ export class WebGPUBackend extends KernelBackend {
};

const kernelMs = await Promise.all(flattenedActiveTimerQueries);
res['kernelMs'] = util.sum(kernelMs);
res['getExtraProfileInfo'] = () =>
res.kernelMs = util.sum(kernelMs);
res.getExtraProfileInfo = () =>
kernelMs.map((d, i) => ({name: flattenedActiveTimerNames[i], ms: d}))
.map(d => `${d.name}: ${d.ms}`)
.join(', ');
Expand Down

0 comments on commit 0ad028b

Please sign in to comment.