onnxruntime
cd2d4a3f - Fix non-deterministic constant folding output (#29789)

Commit
20 days ago
Fix non-deterministic constant folding output (#29789) ### Description From `v1.24.1`, `use_tensor_buffer=true` is set in `TensorToTensorProto` during constant folding. For ops that return aliased OrtValues (e.g. Reshape), the folded initializer referenced memory owned by an input initializer. When that input was removed later in the pass, the reference dangled, producing unstable (often huge/negative) values. Use `out_tensor.OwnsBuffer()` to decide `use_tensor_buffer`. Owned tensors are referenced zero-copy (safe via `OrtValue` shared lifetime); aliased tensors are deep-copied into the proto ### Related issue https://github.com/microsoft/onnxruntime/issues/29788
Author
Parents
Loading