SetShapeInfo

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product AI Core

Atlas inference product Vector Core

Atlas training product

Function Usage

Sets the shape information of a LocalTensor.

Prototype

1
__aicore__ inline void SetShapeInfo(const ShapeInfo& shapeInfo)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

shapeInfo

Input

Shape information, which is of the ShapeInfo structure type.

Returns

None

Restrictions

None

Examples

1
2
3
4
// Example: Set ShapeInfo of a tensor.
AscendC::LocalTensor<float> maxUb = softmaxMaxBuf.template Get<float>();
uint32_t shapeArray[] = {16, 1024};
maxUb.SetShapeInfo(AscendC::ShapeInfo(2, shapeArray, AscendC::DataFormat::ND));