constant folding算法,是将graph中常量的计算合并起来。例如: C = A+B,其中A和B都是constant,比如 A= 2,B =3,则在使用C时,直接使用C =5,而不是使用C =2+3;因为每使用一次C,如果都需要计算一次的话,则浪费了大量计算。
图优化之constant folding
最新推荐文章于 2024-01-26 10:49:28 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
constant folding算法,是将graph中常量的计算合并起来。例如: C = A+B,其中A和B都是constant,比如 A= 2,B =3,则在使用C时,直接使用C =5,而不是使用C =2+3;因为每使用一次C,如果都需要计算一次的话,则浪费了大量计算。