严格融合 ¶
- 类 torch.jit.严格融合[source][source] ¶
如果在推理中不是所有节点都已融合,或在训练中符号性地微分,则报错。
例如:强制加法融合。
@torch.jit.script def foo(x): with torch.jit.strict_fusion(): return x + x + x
如果在推理中不是所有节点都已融合,或在训练中符号性地微分,则报错。
例如:强制加法融合。
@torch.jit.script
def foo(x):
with torch.jit.strict_fusion():
return x + x + x