MakeStride

Supported Products

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference product's AI Core

x

Atlas inference product's Vector Core

x

Atlas training products

x

Functions

Packs the input data into the Stride data structure.

Prototype

1
2
template <typename... Ts>
__aicore__ inline constexpr Stride<Ts...> MakeStride(const Ts&... t)

Parameters

Parameter

Input/Output

Description

Ts...

Input

Indicates the formal parameter pack of the input type. The usage method and restrictions are the same as those of Std::tuple.

Returns

Stride structure type (alias of the Std::tuple type), which is used to define the stride of each dimension in the memory, that is, the interval between adjacent elements in the same dimension in the memory. It corresponds to the dimension information of the shape. The definition is as follows.

1
2
template <typename... Strides>
using Stride = Std::tuple<Strides...>;

Restrictions

Same as Std::tuple.

Examples

For details, see Examples.