Contents

init(device:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:)

Initializes a pooling filter.

Declaration

init(device: any MTLDevice, kernelWidth: Int, kernelHeight: Int, strideInPixelsX: Int, strideInPixelsY: Int)

Parameters

  • device:

    The device the kernel will run on.

  • kernelWidth:

    The width of the kernel.

    This value can be odd or even.

  • kernelHeight:

    The height of the kernel.

    This value can be odd or even.

  • strideInPixelsX:

    The output stride (downsampling factor) in the x dimension.

  • strideInPixelsY:

    The output stride (downsampling factor) in the y dimension.

Return Value

A valid MPSCNNPooling object or nil, if failure.

See Also

Instance Methods