We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 351ba68 commit a9001e2Copy full SHA for a9001e2
docs/guides/paddle_v3_features/sot_cn.md
@@ -16,14 +16,14 @@
16
```python
17
# 一个简单的 Case 如下:
18
@paddle.jit.to_static()
19
-def unsupport_func(x):
+def unsupported_func(x):
20
x = 2 * x
21
t = x.numpy() # t 依赖了 x 的值,依赖静态图的执行结果
22
t = np.ones(t)
23
return paddle.to_tensor(t)
24
25
x = paddle.to_tensor([2])
26
-unsupport_func(x) # raise error
+unsupported_func(x) # raise error
27
```
28
29
这里的 `np.ones` 因为动转静的使用,上述的 `x` 和 `t` 其实都是 `pir.Value` 类型(即 PIR 中的组网占位符),传入到 `np.ones` 中是无法获取到具体的值的,因此调用 `.numpy()` 接口时会报错。而这样的 Case 也是 AST 动转静理论上无法解决的问题,本质原因是,AST 必须要求转写的函数可以**被整图的**静态图 IR 表示。
0 commit comments