Shuffle

Overview

A primitive to shuffle tensor data along an axis. More…

// structs

struct dnnl_shuffle_desc_t;
struct dnnl::shuffle_backward;
struct dnnl::shuffle_forward;

// global functions

dnnl_status_t DNNL_API dnnl_shuffle_forward_desc_init(
    dnnl_shuffle_desc_t* shuffle_desc,
    dnnl_prop_kind_t prop_kind,
    const dnnl_memory_desc_t* data_desc,
    int axis,
    dnnl_dim_t group_size
    );

dnnl_status_t DNNL_API dnnl_shuffle_backward_desc_init(
    dnnl_shuffle_desc_t* shuffle_desc,
    const dnnl_memory_desc_t* diff_data_desc,
    int axis,
    dnnl_dim_t group_size
    );

Detailed Documentation

A primitive to shuffle tensor data along an axis.

See also:

Shuffle in developer guide

Global Functions

dnnl_status_t DNNL_API dnnl_shuffle_forward_desc_init(
    dnnl_shuffle_desc_t* shuffle_desc,
    dnnl_prop_kind_t prop_kind,
    const dnnl_memory_desc_t* data_desc,
    int axis,
    dnnl_dim_t group_size
    )

Initializes a descriptor for shuffle forward propagation primitive.

Parameters:

shuffle_desc

Output descriptor for a shuffle primitive.

prop_kind

Propagation kind. Possible values are dnnl_forward_training and dnnl_forward_inference.

data_desc

Source and destination memory descriptor.

axis

The axis along which the data is shuffled.

group_size

Shuffle group size.

Returns:

dnnl_success on success and a status describing the error otherwise.

dnnl_status_t DNNL_API dnnl_shuffle_backward_desc_init(
    dnnl_shuffle_desc_t* shuffle_desc,
    const dnnl_memory_desc_t* diff_data_desc,
    int axis,
    dnnl_dim_t group_size
    )

Initializes a descriptor for shuffle backward propagation primitive.

Parameters:

shuffle_desc

Output descriptor for a shuffle primitive.

diff_data_desc

Diff source and diff destination memory descriptor.

axis

The axis along which the data is shuffled.

group_size

Shuffle group size.

Returns:

dnnl_success on success and a status describing the error otherwise.