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

Method constructor

tfjs-backend-webgpu/src/pad_webgpu.ts:64–75  ·  view source on GitHub ↗
(xShape: number[], paddings: Array<[number, number]>)

Source from the content-addressed store, hash-verified

62 size = true;
63
64 constructor(xShape: number[], paddings: Array<[number, number]>) {
65 this.outputShape = paddings.map(
66 (p, i) => p[0] /* beforePad */ + xShape[i] + p[1] /* afterPad */);
67 this.dispatchLayout = flatDispatchLayout(this.outputShape);
68 this.dispatch = computeDispatch(
69 this.dispatchLayout, this.outputShape, this.workgroupSize);
70 paddings.map((_, i) => {
71 this.uniforms += ` pad${i} : vec2<i32>,`;
72 });
73 this.xShape = xShape;
74 this.shaderKey = 'pad';
75 }
76
77 getUserCode(): string {
78 const userCode = `

Callers

nothing calls this directly

Calls 2

flatDispatchLayoutFunction · 0.90
computeDispatchFunction · 0.90

Tested by

no test coverage detected