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

    const { layer } = attrs

    if (!layer) {
      this.throwError('wrapped layer is undefined.')
    }

    const wrappedLayerAttrs = Object.assign({}, layer.config, { gpu: attrs.gpu })
    this.wrappedLayer = new layers[layer.class_name](wrappedLayerAttrs)

    // prevent GPU -> CPU data transfer by specifying non-empty outbound nodes array on internal layer
    this.wrappedLayer.outbound = [null]

    // GPU setup
    if (this.gpu) {
      this.copyTextureProgram = webgl2.compileProgram(copyTextureProgramSource)
      this.mapInputProgram = webgl2.compileProgram(mapInputProgramSource)
      this.selectSliceProgram = webgl2.compileProgram(selectSliceProgramSource)
      this.copySliceOutputProgram = webgl2.compileProgram(copySliceOutputProgramSource)
      this.mapSliceOutputProgram = webgl2.compileProgram(mapSliceOutputProgramSource)
    }
  }
Creates a TimeDistributed wrapper layer

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