MCPcopy Create free account
hub / github.com/tensorflow/tfjs / tilesFitEvenlyIntoShape

Function tilesFitEvenlyIntoShape

tfjs-backend-webgpu/src/webgpu_util.ts:27–37  ·  view source on GitHub ↗
(
    tileSize: number[], shape: number[])

Source from the content-addressed store, hash-verified

25};
26
27export function tilesFitEvenlyIntoShape(
28 tileSize: number[], shape: number[]): boolean {
29 if (tileSize.length !== shape.length) {
30 throw new Error(
31 `Cannot compute whether rank ${tileSize.length}` +
32 ` tiles fit evenly into rank ${shape.length} shape` +
33 ` - ranks must match.`);
34 }
35 return shape.every(
36 (dim: number, dimIdx: number) => dim % tileSize[dimIdx] === 0);
37}
38
39// Computes dispatch geometry based on layout of output dimensions and
40// workgroupSize.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…