viable/strict/1790184407: Support tensor torch._assert in export (#186306)
- PyTorch: 1439 events in the last 90 days
- PyTorch: 1420th Release in the last 90 days
- Previous: earlier the same day · viable/strict/1790182282: Use COMPILE_DEFINITIONS property instead of COMPILE_FLAGS (#198204)
What happened
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(…
Summary assembled by rule from the sources below