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

Method constructor

tfjs-backend-webgpu/src/pool_webgpu.ts:147–166  ·  view source on GitHub ↗
(
      convInfo: backend_util.Conv3DInfo, poolType: 'max'|'avg',
      computePositions = false, flattenPositions = false,
      includeBatchIndex = false)

Source from the content-addressed store, hash-verified

145 includeBatchIndex: boolean;
146
147 constructor(
148 convInfo: backend_util.Conv3DInfo, poolType: 'max'|'avg',
149 computePositions = false, flattenPositions = false,
150 includeBatchIndex = false) {
151 if (poolType === 'avg' && computePositions) {
152 throw new Error('Cannot compute positions for average pool.');
153 }
154
155 this.outputShape = convInfo.outShape;
156 this.dispatchLayout = flatDispatchLayout(this.outputShape);
157 this.dispatch = computeDispatch(
158 this.dispatchLayout, this.outputShape, this.workgroupSize);
159
160 this.poolType = poolType;
161 this.computePositions = computePositions;
162 this.flattenPositions = flattenPositions;
163 this.includeBatchIndex = includeBatchIndex;
164 this.shaderKey = `pool3D_${poolType}_${computePositions}_${
165 flattenPositions}_${includeBatchIndex}`;
166 }
167
168 getUserCode(): string {
169 let updateSnippet: string;

Callers

nothing calls this directly

Calls 2

flatDispatchLayoutFunction · 0.90
computeDispatchFunction · 0.90

Tested by

no test coverage detected