Skip to main content
`Ctrl`+`K`

# Getitem

MIOpen: Getitem
Functions
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.

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.

## 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] | handle | MIOpen Handle
  [in] | indexCount | Number of input tensor indexs
  [in] | indexDescs | Tensor descriptor of input tensor indexs
  [out] | sizeInBytes | Pointer to data to return the minimum workspace size

Returns
  miopenStatus_t

## ◆ 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] | handle | MIOpen handle
  [in] | workspace | Address of the allocated workspace data
  [in] | workspaceSizeInBytes | Size in bytes of the allocated workspace data
  [in] | dyDesc | Tensor descriptor of input tensor dy
  [in] | dy | Source data tensor dy
  [in] | indexCount | Number of input tensor indexs
  [in] | indexDescs | Tensor descriptor of input tensor indexs(All indexs same size)
  [in] | indexs | Source data tensor indexs
  [in] | dxDesc | Tensor descriptor of output tensor dx
  [out] | dx | Data tensor dx(It must be initialized to 0)
  [in] | errorDesc | Tensor descriptor of output tensor error
  [out] | error | Data tensor error(It must be initialized to 0)
  [in] | dimCount | Number of dimensions
  [in] | dims | Dimensions
  [in] | sliceCount | Number of slices
  [in] | slices | Slices
  [in] | offset | Offset of output tensor dx

Returns
  miopenStatus_t