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

Method constructor

tfjs-backend-webgpu/src/scatter_webgpu.ts:39–59  ·  view source on GitHub ↗
(
      flattenXShape: number[], sliceDim: number, indicesRank: number,
      updatesRank: number, strides: number[], shape: number[],
      outputDtype: DataType, sumDupeIndices = true)

Source from the content-addressed store, hash-verified

37 type: DataType;
38
39 constructor(
40 flattenXShape: number[], sliceDim: number, indicesRank: number,
41 updatesRank: number, strides: number[], shape: number[],
42 outputDtype: DataType, sumDupeIndices = true) {
43 this.outputShape = shape;
44 this.type = outputDtype;
45 this.sumDupeIndices = sumDupeIndices;
46 this.dispatchLayout = flatDispatchLayout(flattenXShape);
47 // Dispatching based on |updates| shape instead of output shape.
48 this.dispatch =
49 computeDispatch(this.dispatchLayout, flattenXShape, this.workgroupSize);
50 this.sliceDimGreaterThanOne = sliceDim > 1;
51 this.shaderKey =
52 `scatter_${indicesRank}_${updatesRank}_${this.sliceDimGreaterThanOne}_${
53 outputDtype}_${sumDupeIndices}_${strides.length}`;
54 const stridesType = getCoordsDataType(strides.length);
55 this.uniforms =
56 `sliceDim : i32, strides: ${stridesType}, updatesSize: i32,`;
57 this.updatesRank = updatesRank;
58 this.indicesRank = indicesRank;
59 }
60
61 getUserCode(): string {
62 let indicesString = '';

Callers

nothing calls this directly

Calls 3

flatDispatchLayoutFunction · 0.90
computeDispatchFunction · 0.90
getCoordsDataTypeFunction · 0.90

Tested by

no test coverage detected