static */
| 109 | } // namespace |
| 110 | |
| 111 | /* static */ Layout LayoutUtil::GetDefaultLayoutForShape(const Shape& shape) { |
| 112 | if (shape.IsOpaque() || shape.IsToken()) { |
| 113 | // Opaque and token types have empty layouts. |
| 114 | return Layout(); |
| 115 | } |
| 116 | |
| 117 | // A Layout proto corresponds to a single array, not a tuple. |
| 118 | CHECK(shape.IsArray()); |
| 119 | return CreateDefaultLayoutForRank(shape.dimensions_size()); |
| 120 | } |
| 121 | |
| 122 | /* static */ Layout LayoutUtil::GetDefaultLayoutForRank(int64 rank) { |
| 123 | return CreateDefaultLayoutForRank(rank); |
nothing calls this directly
no test coverage detected