constructor(attrs = {}) {
    super(attrs)
    this.layerClass = '_Pooling2D'

    const { pool_size = [2, 2], strides = null, padding = 'valid', data_format = 'channels_last' } = attrs

    if (Array.isArray(pool_size)) {
      this.poolSize = pool_size
    } else {
      this.poolSize = [pool_size, pool_size]
    }

    if (Array.isArray(strides)) {
      this.strides = strides
    } else if (strides !== null) {
      this.strides = [strides, strides]
    } else {
      this.strides = this.poolSize
    }

    this.padding = padding
    this.dataFormat = data_format

    // default pooling function
    // can be `max` or `average`
    this.poolingFunc = 'max'

    this.description = `pool size ${this.poolSize.join('x')}`
    this.description += this.strides.some(s => s > 1) ? `, ${this.strides.join('x')} striding` : ''
    this.description += this.padding === 'valid' ? `, no border padding` : ', pad to same borders'

    // GPU setup
    if (this.gpu) {
      this.poolingProgram = webgl2.compileProgram(poolingProgramSource)
      this.poolingFragmentsProgram = webgl2.compileProgram(poolingFragmentsProgramSource)
    }
  }
Creates a _Pooling2D layer

@param {Object} [attrs] - layer config attributes