Clarify the documentation for PermuteDimensions

PiperOrigin-RevId: 316616603
Change-Id: Iccfbd986276688bdc25b6757cdee6806f0b587d6
This commit is contained in:
A. Unique TensorFlower 2020-06-15 22:24:35 -07:00 committed by TensorFlower Gardener
parent 7ee9571a8e
commit e74010b4e8

View File

@ -968,17 +968,18 @@ Status ForEachMutableSubshapeHelper(
// `shape`'s list of dimensions is isomorphic to the identity I. // `shape`'s list of dimensions is isomorphic to the identity I.
// //
// Let `shape`'s layout be L. A layout is a permutation which maps a // Let `shape`'s layout be L. A layout is a permutation which maps a
// minor-to-major physical layout to the order of a shape's logical dims. // minor-to-major physical dimension ordering to a shape's logical dimension
// Therefore inverse of a layout maps from logical to physical dims, and so // ordering. Therefore the inverse of a layout maps from logical to physical
// the physical layout of I is simply L'.I = L', where L' is the inverse of L. // dims, and so the physical ordering of I is simply L'.I = L', where L' is
// the inverse of L.
// //
// Let the argument `permutation` be P. This is a permutation over `shape`'s // Let the argument `permutation` be P. This is a permutation over `shape`'s
// dimensions, so our return value will be a shape with dims P.I = P. Our // dimensions, so our return value will be a shape with dims P.I = P. Our
// goal is to construct a layout permutation L* that we can apply to P such // goal is to construct a layout permutation L* for this shape. The physical
// that the physical dimension ordering of the returned shape is the same // dimension ordering of this returned shape must be the same as that of the
// as that of the original shape, namely L'. // original shape, namely L'.
// //
// Our returned shape has dims P and layout L*, so its in-memory layout is // Our returned shape has dims P and layout L*, so its in-memory ordering is
// L*'.P. Setting this equal to L' and solving for L*, we get: // L*'.P. Setting this equal to L' and solving for L*, we get:
// //
// L*'.P = L' => // L*'.P = L' =>