Commit e1b51397 authored by Blake Hechtman's avatar Blake Hechtman Committed by TensorFlower Gardener
Browse files

PR #23661: [XLA] Simplify transposes that are really reshapes

Please approve this CL. It will be submitted automatically, and its GitHub pull request will be marked as merged.

Imported from GitHub PR #23661

A transpose like
```
f32[1,1,64,1] = transpose(f32[1,64,1,1]), dimensions={3,2,1,0}
```
is really just a reshape (because there's only one non-1 dimension).
Teach algebraic simplifier to make that substitution, to enable applying
reshape-combining optimizations to such instructions.

Copybara import of the project:

  - c51f19ef50f993677d7d58d9dcf3de6785540e0b [XLA] Simplify transposes that are really reshapes by Keno Fischer <keno@juliacomputing.com>
  - 10fe3503be362e28906e6a01d0d272903f693817 [XLA] Canonicalize Transpose by dropping degenerate dims by Keno Fischer <keno@juliacomputing.com>
  - 333cdccc3a045ebdb36ca03e8877706d5659642e Merge 10fe3503be362e28906e6a01d0d272903f693817 into 3dfb4... by Keno Fischer <keno@alumni.harvard.edu>

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/tensorflow/pull/23661 from JuliaComputing:kf/transposereshape 10fe3503be362e28906e6a01d0d272903f693817
PiperOrigin-RevId: 225416731
parent fe4328b4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment