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

Function getInputSnippet

tfjs-backend-webgpu/src/webgpu_program.ts:627–639  ·  view source on GitHub ↗
(
    inputInfo: InputInfo, outShape: number[], component: number,
    isFlatDispatchLayout: boolean)

Source from the content-addressed store, hash-verified

625}
626
627function getInputSnippet(
628 inputInfo: InputInfo, outShape: number[], component: number,
629 isFlatDispatchLayout: boolean): string {
630 let res = getInputAtCoordsSnippet(inputInfo, component);
631
632 const inShape = inputInfo.shape;
633 if (inShape.length <= outShape.length) {
634 res += getInputByOutputSnippet(
635 inputInfo, outShape, component, isFlatDispatchLayout);
636 }
637
638 return res;
639}
640
641/**
642 * Generates getOutputCoords() function that computes output coordinates

Callers 1

makeShaderFunction · 0.85

Calls 2

getInputAtCoordsSnippetFunction · 0.85
getInputByOutputSnippetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…