ShapeInfo
Function
Stores the shape information of LocalTensor or GlobalTensor.
Prototype
- ShapeInfo structure
1 2 3 4 5 6 7 8 9 10 11 12 13
struct ShapeInfo { public: __aicore__ inline ShapeInfo(); __aicore__ inline ShapeInfo(const uint8_t inputShapeDim, const uint32_t inputShape[], const uint8_t inputOriginalShapeDim, const uint32_t inputOriginalShape[], const DataFormat inputFormat); __aicore__ inline ShapeInfo(const uint8_t inputShapeDim, const uint32_t inputShape[], const DataFormat inputFormat); __aicore__ inline ShapeInfo(const uint8_t inputShapeDim, const uint32_t inputShape[]); uint8_t shapeDim; uint8_t originalShapeDim; uint32_t shape[K_MAX_DIM]; uint32_t originalShape[K_MAX_DIM]; DataFormat dataFormat; };
- Obtains the product of all dimensions in a shape.
1__aicore__ inline int GetShapeSize(const ShapeInfo& shapeInfo)
Function Description
Parameter |
Description |
||
|---|---|---|---|
shapeDim |
Current shape dimension. |
||
shape |
Current shape. |
||
originalShapeDim |
Original shape dimension. |
||
originalShape |
Original shape. |
||
dataFormat |
Data format. The DataFormat type is defined as follows:
|
Parameter |
Input/Output |
Description |
|---|---|---|
shapeInfo |
Input |
ShapeInfo type, shape information of the LocalTensor or GlobalTensor. |
Parent topic: Other Data Types