Shortcuts

torch.fx.experimental.symbolic_shapes.statically_known_true

torch.fx.experimental.symbolic_shapes.statically_known_true(x)[源代码]

如果 x 可以简化为一个常量并且为真,则返回 True。

注意

此函数不会引入新的保护措施,因此即使此函数返回 False,表达式在运行时也可能最终评估为 true。

Parameters

x (布尔值, SymBool) – 要尝试静态评估的表达式

Return type

bool

优云智算