Skip to content

Commit e7b7d63

Browse files
committed
update frontend related desc
1 parent 5ea8a7f commit e7b7d63

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

rfcs/CINN/APIs/20220802_cinn_api_design_one_hot.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# CINN one_hot 设计文档
22

3-
| API 名称 | 新增 API 名称 |
3+
| API 名称 | one_hot |
44
| -------------- | ----------------------------------- |
55
| 提交作者 | Nyakku Shigure(@SigureMo|
66
| 提交时间 | 2022-08-02 |
7-
| 版本号 | v0.2 |
7+
| 版本号 | v0.3 |
88
| 依赖 CINN 版本 | develop |
99
| 文件名 | 20220802_cinn_api_design_one_hot.md |
1010

@@ -401,8 +401,8 @@ ir::Tensor OneHot(const ir::Tensor& indices,
401401
API 设计如下:
402402
403403
```cpp
404-
// cinn/frontend/base_builder.h
405-
class BaseBuilder {
404+
// cinn/frontend/net_builder.h
405+
class NetBuilder {
406406
Variable OneHot(const Variable& indices,
407407
const Variable& on_value,
408408
const Variable& off_value,
@@ -415,7 +415,7 @@ class BaseBuilder {
415415
Python 端调用示例如下:
416416

417417
```python
418-
builder = frontend.CinnBuilder(name="one_hot")
418+
builder = frontend.NetBuilder(name="one_hot")
419419

420420
indices = builder.create_input(type=common.Float(32), shape=(3, ), id_hint="A")
421421
on_value = builder.create_input(type=common.Float(32), shape=(), id_hint="B")
@@ -440,7 +440,7 @@ res = builder.one_hot(indices, on_value, off_value, depth=3, axis=-1, dtype="flo
440440
具体规划为:
441441

442442
- 编写 Compute、InferShape、InferDtype、Strategy,并注册算子
443-
- 向前端 BaseBuilder 添加该 API
443+
- 向前端 NetBuilder 添加该 API
444444
- 向前端 Paddle 添加该算子
445445
- 该算子单测
446446

0 commit comments

Comments
 (0)