viable/strict/1790184407: Support tensor torch._assert in export (#186306)
- PyTorch 近 90 天出现 1438 次
- PyTorch 近 90 天第 1419 次发版
- 上一次:同一天稍早 · viable/strict/1790182282: Use COMPILE_DEFINITIONS property instead of COMPILE_FLAGS (#198204)
发生了什么
torch._assert only had special Dynamo handling for statically true Python constants and symbolic expressions. Tensor-valued conditions fell through to the eager Python implementation, whose if not condition forced proxy tensors through Python truthiness. During export this produced a data-dependent guard such as Eq(u0, 1) instead of preserving the assertion in the exported program. Lower tensor-valued torch._assert(…
摘要按规则整理自下方来源原文