产品 |
是否支持 |
|---|---|
Ascend 950PR/Ascend 950DT |
x |
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
重载运算符(),内部实现为调用Crd2Idx接口,将多维坐标(Coordinate)通过布局(Layout)转换为内存位置索引(Index)。
1 2 | template <typename CoordType> __aicore__ inline constexpr auto operator()(const CoordType& coord) const {} |
参数名 |
输入/输出 |
描述 |
|---|---|---|
coord |
输入 |
Coord结构类型,用于表示张量在不同维度上的坐标值。 |
返回根据Coordinate信息转换之后的索引值。
无
1 2 3 | ... auto layout = AscendC::MakeLayout(shape, stride); auto index = layout(coord); |