strict_fusion

类 torch.jit.strict_fusion[源代码]

如果没有在推理过程中融合所有节点,或者在训练过程中没有进行符号微分,则报告错误。

示例:强制合并添加操作。

@torch.jit.script
def foo(x):
    with torch.jit.strict_fusion():
        return x + x + x
本页目录