产品 |
是否支持 |
|---|---|
Ascend 950PR/Ascend 950DT |
√ |
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
生成TensorTrait实例化对象。
1 2 | template <typename T, TPosition pos, typename LayoutType> __aicore__ inline constexpr auto MakeTensorTrait(const LayoutType& t) |
参数名 |
描述 |
|---|---|
T |
只支持如下基础数据类型:int4b_t、uint8_t、int8_t、int16_t、uint16_t、bfloat16_t、int32_t、uint32_t、int64_t、uint64_t、float、half 。 在TensorTrait结构体内部,使用using关键字定义了一个类型别名LiteType,与模板参数T类型一致。 通过TensorTrait定义的LocalTensor/GlobalTensor不包含ShapeInfo信息。 例如:LocalTensor<float>对应的不含ShapeInfo信息的Tensor为LocalTensor<TensorTrait<float>>。 |
pos |
数据存放的逻辑位置,Tposition类型。 |
LayoutType |
返回TensorTrait实例化对象。
无
见调用示例。