Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
PermuteLayer functions

Functions to accelerate PermuteLayer in Synet Framework. More...

Functions

SIMD_API void * SimdSynetPermuteInit (const size_t *shape, const size_t *order, size_t count, SimdTensorDataType type)
 Initializes a tensor permutation context. More...
 
SIMD_API size_t SimdSynetPermuteInternalBufferSize (const void *context)
 Gets the size in bytes of internal storage used by a permute context. More...
 
SIMD_API void SimdSynetPermuteForward (void *context, const uint8_t *src, uint8_t *dst)
 Performs tensor dimension permutation. More...
 

Detailed Description

Functions to accelerate PermuteLayer in Synet Framework.

Function Documentation

◆ SimdSynetPermuteInit()

void * SimdSynetPermuteInit ( const size_t *  shape,
const size_t *  order,
size_t  count,
SimdTensorDataType  type 
)

Initializes a tensor permutation context.

The context reorders tensor dimensions. If input shape is shape[0..count-1], then output dimension i has size shape[order[i]]. Supported dimension count is from 2 to 5. Dimensions with size 1 can be skipped by the implementation, but the requested permutation must change at least two non-unit dimensions. Supported tensor types are FP32, INT32, INT8, UINT8, BF16 and FP16.

Parameters
[in]shape- a pointer to input tensor shape. The array size must be equal to count.
[in]order- a pointer to output dimension order. The array size must be equal to count and contain a permutation of dimension indices.
[in]count- a count of dimensions of input and output tensor.
[in]type- an input and output tensor data type.
Returns
a pointer to permute context. On error it returns NULL. It must be released with function SimdRelease. This pointer is used in functions SimdSynetPermuteInternalBufferSize, and SimdSynetPermuteForward.

◆ SimdSynetPermuteInternalBufferSize()

size_t SimdSynetPermuteInternalBufferSize ( const void *  context)

Gets the size in bytes of internal storage used by a permute context.

Parameters
[in]context- a pointer to permute context. It must be created by function SimdSynetPermuteInit and released by function SimdRelease.
Returns
size in bytes of internal storage used by the permutation implementation.

◆ SimdSynetPermuteForward()

void SimdSynetPermuteForward ( void *  context,
const uint8_t *  src,
uint8_t *  dst 
)

Performs tensor dimension permutation.

Parameters
[in]context- a pointer to permute context. It must be created by function SimdSynetPermuteInit and released by function SimdRelease.
[in]src- a pointer to the input tensor bytes.
[out]dst- a pointer to the output tensor bytes. Its shape is determined by the order parameter passed to SimdSynetPermuteInit.