Skip to main content

ClikaRT::ops::pixel_shuffle

function

pixel_shuffle()

Tensor pixel_shuffle(
    Tensor x,
    int64_t upscale_factor,
    PixelShuffleMode mode = PixelShuffleMode::CRD
)

Rearranges channels into space (depth-to-space): channels-last [N, H, W, C] becomes [N, H*r, W*r, C/r^2].

Parameters

  • x: [N, H, W, C] with C divisible by r^2.
  • upscale_factor: r.
  • mode: the channel unpack order (CRD / DCR). Default PixelShuffleMode::CRD.

Throws

  • ClikaRT::Error: when the input's dtype/shape is not served for this operation (the machine-readable reason rides code_name()).

Returns: [N, H*r, W*r, C/r^2].

Declared in ClikaRT/compute/ops.h, line 4500