GridSampleLayer functions
Functions to acceleratŠµ GridSampleLayer in Synet Framework. More...
Enumerations | |
enum | SimdGridSampleInterpType { SimdGridSampleInterpBilinear = 0 , SimdGridSampleInterpNearest , SimdGridSampleInterpBicubic } |
enum | SimdGridSamplePaddingType { SimdGridSamplePaddingZeros = 0 , SimdGridSamplePaddingBorder , SimdGridSamplePaddingReflect } |
Functions | |
SIMD_API void * | SimdSynetGridSample2dInit (size_t batch, size_t channels, size_t srcH, size_t srcW, size_t dstH, size_t dstW, SimdTensorDataType type, SimdGridSampleInterpType interp, SimdGridSamplePaddingType padding, SimdBool align) |
Initilizes grid sample 2D algorithm. More... | |
SIMD_API size_t | SimdSynetGridSample2dInternalBufferSize (const void *context) |
Gets size of internal buffer used inside permute algorithm. More... | |
SIMD_API void | SimdSynetGridSample2dForward (void *context, const uint8_t *src, const uint8_t *grd, uint8_t *dst) |
Performs forward propagation of grid sample algorithm. More... | |
Detailed Description
Functions to acceleratŠµ GridSampleLayer in Synet Framework.
Enumeration Type Documentation
◆ SimdGridSampleInterpType
Describes grid sample interpolation type. It is used in function SimdSynetGridSample2dInit.
Enumerator | |
---|---|
SimdGridSampleInterpBilinear | Using of bilinear interpolation. |
SimdGridSampleInterpNearest | Using of nearest pixel value. |
SimdGridSampleInterpBicubic | Using of bicubic interpolation. |
◆ SimdGridSamplePaddingType
Describes grid sample padding type. It is used in function SimdSynetGridSample2dInit.
Function Documentation
◆ SimdSynetGridSample2dInit()
void * SimdSynetGridSample2dInit | ( | size_t | batch, |
size_t | channels, | ||
size_t | srcH, | ||
size_t | srcW, | ||
size_t | dstH, | ||
size_t | dstW, | ||
SimdTensorDataType | type, | ||
SimdGridSampleInterpType | interp, | ||
SimdGridSamplePaddingType | padding, | ||
SimdBool | align | ||
) |
Initilizes grid sample 2D algorithm.
- Parameters
-
[in] batch - a batch size. [in] channels - a number of channels in the input and output tensors. [in] srcH - a height of input tensor. [in] srcW - a width of input tensor. [in] dstH - a height of output tensor. [in] dstW - a width of output tensor. [in] type - a type of input, grid and output tensor. [in] interp - an interpolation type. [in] padding - a padding type. [in] align - a flag to align corners.
- Returns
- a pointer to grid sample 2D context. On error it returns NULL. It must be released with using of function SimdRelease. This pointer is used in functions SimdSynetGridSample2dInternalBufferSize, and SimdSynetGridSample2dForward.
◆ SimdSynetGridSample2dInternalBufferSize()
size_t SimdSynetGridSample2dInternalBufferSize | ( | const void * | context | ) |
Gets size of internal buffer used inside permute algorithm.
- Parameters
-
[in] context - a pointer to grid sample 2D context. It must be created by function SimdSynetGridSample2dInit and released by function SimdRelease.
- Returns
- size of internal buffer used inside grid sample 2D algorithm.
◆ SimdSynetGridSample2dForward()
void SimdSynetGridSample2dForward | ( | void * | context, |
const uint8_t * | src, | ||
const uint8_t * | grd, | ||
uint8_t * | dst | ||
) |
Performs forward propagation of grid sample algorithm.
- Parameters
-
[in] context - a pointer to grid sample 2D context. It must be created by function SimdSynetGridSample2dInit and released by function SimdRelease. [in] src - a pointer to input tensor. It has size = batch * channels * srcH * srcW. [in] grd - a pointer to grid tensor. It has size = batch * dstH * dstW * 2. [out] dst - a pointer to output tensor. It has size = batch * channels * dstH * dstW.