(
convInfo: backend_util.Conv2DInfo, poolType: 'max'|'avg',
computePositions = false, flattenPositions = false,
includeBatchIndex = false)
| 37 | includeBatchIndex: boolean; |
| 38 | |
| 39 | constructor( |
| 40 | convInfo: backend_util.Conv2DInfo, poolType: 'max'|'avg', |
| 41 | computePositions = false, flattenPositions = false, |
| 42 | includeBatchIndex = false) { |
| 43 | if (poolType === 'avg' && computePositions) { |
| 44 | throw new Error('Cannot compute positions for average pool.'); |
| 45 | } |
| 46 | |
| 47 | this.outputShape = convInfo.outShape; |
| 48 | this.dispatchLayout = flatDispatchLayout(this.outputShape); |
| 49 | this.dispatch = computeDispatch( |
| 50 | this.dispatchLayout, this.outputShape, this.workgroupSize); |
| 51 | |
| 52 | this.poolType = poolType; |
| 53 | this.computePositions = computePositions; |
| 54 | this.flattenPositions = flattenPositions; |
| 55 | this.includeBatchIndex = includeBatchIndex; |
| 56 | this.shaderKey = `pool2D_${poolType}_${computePositions}_${ |
| 57 | flattenPositions}_${includeBatchIndex}`; |
| 58 | } |
| 59 | |
| 60 | getUserCode(): string { |
| 61 | let updateSnippet: string; |
nothing calls this directly
no test coverage detected