Function nn_tensor_shuffle

Source
pub unsafe extern "C" fn nn_tensor_shuffle(
    output: *mut NNTensor,
    input: *mut NNTensor,
    n_dims: i32,
    order: *const i32,
) -> NNError
Expand description

Shuffles (transpose) the tensor moving the current dimensions into the ordering defined in the order parameter.

For example a traditional matrix transpose is done using order[] = { 1, 0 } in other words, the 0 dimension of the output references the 1 dimension of the input and the 1 dimension of the output references the 0 dimension of the input.

Another example would be shuffling an NCHW tensor to NHWC using order[] = { 0, 2, 3, 1 }

@public @memberof NNTensor @since 2.0