This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

Getitem

Getitem#

MIOpen: Getitem
Getitem

Functions

miopenStatus_t miopenGetGetitemWorkspaceSize (miopenHandle_t handle, uint32_t indexCount, const miopenTensorDescriptor_t *indexDescs, size_t *sizeInBytes)
 Helper function to query the minimum workspace size required by the getitem call. More...
 
miopenStatus_t miopenGetitemBackward (miopenHandle_t handle, void *workspace, size_t workspaceSizeInBytes, const miopenTensorDescriptor_t dyDesc, const void *dy, uint32_t indexCount, const miopenTensorDescriptor_t *indexDescs, const void *const *indexs, const miopenTensorDescriptor_t dxDesc, void *dx, const miopenTensorDescriptor_t errorDesc, void *error, uint32_t dimCount, const int32_t *dims, uint32_t sliceCount, const int32_t *slices, uint32_t offset)
 Execute a getitem backward layer. More...
 

Detailed Description

Function Documentation

◆ miopenGetGetitemWorkspaceSize()

miopenStatus_t miopenGetGetitemWorkspaceSize ( miopenHandle_t  handle,
uint32_t  indexCount,
const miopenTensorDescriptor_t *  indexDescs,
size_t *  sizeInBytes 
)

Helper function to query the minimum workspace size required by the getitem call.

Parameters
[in]handleMIOpen Handle
[in]indexCountNumber of input tensor indexs
[in]indexDescsTensor descriptor of input tensor indexs
[out]sizeInBytesPointer to data to return the minimum workspace size
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/develop/include/miopen/miopen.h.

◆ miopenGetitemBackward()

miopenStatus_t miopenGetitemBackward ( miopenHandle_t  handle,
void *  workspace,
size_t  workspaceSizeInBytes,
const miopenTensorDescriptor_t  dyDesc,
const void *  dy,
uint32_t  indexCount,
const miopenTensorDescriptor_t *  indexDescs,
const void *const *  indexs,
const miopenTensorDescriptor_t  dxDesc,
void *  dx,
const miopenTensorDescriptor_t  errorDesc,
void *  error,
uint32_t  dimCount,
const int32_t *  dims,
uint32_t  sliceCount,
const int32_t *  slices,
uint32_t  offset 
)

Execute a getitem backward layer.

Backward of getitem for tensor indexing, slicing, masking.

Parameters
[in]handleMIOpen handle
[in]workspaceAddress of the allocated workspace data
[in]workspaceSizeInBytesSize in bytes of the allocated workspace data
[in]dyDescTensor descriptor of input tensor dy
[in]dySource data tensor dy
[in]indexCountNumber of input tensor indexs
[in]indexDescsTensor descriptor of input tensor indexs(All indexs same size)
[in]indexsSource data tensor indexs
[in]dxDescTensor descriptor of output tensor dx
[out]dxData tensor dx(It must be initialized to 0)
[in]errorDescTensor descriptor of output tensor error
[out]errorData tensor error(It must be initialized to 0)
[in]dimCountNumber of dimensions
[in]dimsDimensions
[in]sliceCountNumber of slices
[in]slicesSlices
[in]offsetOffset of output tensor dx
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/develop/include/miopen/miopen.h.