Contents

BNNSShuffle(_:_:_:_:)

Rearranges elements in a tensor according to shuffle type.

Declaration

func BNNSShuffle(_ type: BNNSShuffleType, _ input: UnsafePointer<BNNSNDArrayDescriptor>, _ output: UnsafeMutablePointer<BNNSNDArrayDescriptor>, _ filter_params: UnsafePointer<BNNSFilterParameters>?) -> Int32

Parameters

  • type:

    A constant that specifies the shuffle type.

  • input:

    A pointer to the input descriptor.

  • output:

    A pointer to the output descriptor.

  • filter_params:

    The filter runtime parameters.

Discussion

Use BNNSShuffle(_:_:_:_:) to rearrange the elements in a tensor between the depth dimension and blocks of 2D spatial data.

Pass a shuffle type of BNNSShuffleTypePixelShuffleNCHW to specify that the function rearranges elements in a tensor of shape (N,C×r×r,H,W) to a tensor of shape (N,C,H×r,W×r), where r is an upscale factor.

Pass BNNSShuffleTypePixelUnshuffleNCHW to specify that the function elements in a tensor of shape (N,C,H×r,W×r) to a tensor of shape (N,C×r×r,H,W), where r is a downscale factor.

See Also

Errors