| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 3 个月前 | ||
| 3 个月前 |
Tile
贡献说明
| 贡献者 | 贡献方 | 贡献算子 | 贡献时间 | 贡献内容 |
|---|---|---|---|---|
| ElevenLiu | 智子芯元(深圳)科技有限责任公司 | Tile | 2026/04 | 新增Tile算子适配开源仓 |
支持的产品型号
- Atlas A2系列产品
算子描述
-
功能描述
Tile算子将输入张量按指定倍数在各维度重复拼接,等价于numpy.tile(input, multiples)或 PyTorchtensor.repeat(multiples)。 -
计算公式
output[i0,i1,...,iN]=input[i0 mod s0,i1 mod s1,...,iN mod sN]output[i_0, i_1, ..., i_N] = input[i_0 \bmod s_0, i_1 \bmod s_1, ..., i_N \bmod s_N]
其中 s0,s1,...,sNs_0, s_1, ..., s_N 为输入各维度大小。
-
原型信息
算子类型(OpType) Tile name Type data type format 算子输入 x tensor float32, float16, bfloat16, int32, int16, int8, uint8, uint16, uint32, uint64, bool, complex64 ND multiples tensor int32, int64 ND 算子输出 y tensor 与x一致 ND 核函数名 tile
约束与限制
- 输入张量维度范围 1-8,仅支持 ND 格式
- int64、double 数据类型暂不支持
- multiples 各维度值须为正整数 (≥1)
- 输入/输出总元素数须在 int32 范围内
算子使用
使用该算子前,请参考社区版CANN开发套件包安装文档完成开发运行环境的部署。
编译部署
-
进入到仓库目录
cd ${git_clone_path}/ops-math -
执行编译
bash build.sh --pkg --experimental --soc=ascend910b --ops=tile -
部署算子包
./build_out/cann-ops-<vendor_name>-linux.<arch>.run
调用说明
Tile 算子对应 aclnn 层接口为 aclnnRepeat(已内置于 CANN 包中),通过 tensor.repeat(multiples) 方式调用。
| 调用方式 | 调用样例 | 说明 |
|---|---|---|
| aclnn调用 | test_aclnn_tile | 通过aclnnRepeat接口方式调用Tile算子 |
执行调用
bash build.sh --experimental --run_example tile eager cust --vendor_name=custom