MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetDefaultLayoutForShape

Method GetDefaultLayoutForShape

tensorflow/compiler/xla/layout_util.cc:111–120  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 6

IsOpaqueMethod · 0.80
IsTokenMethod · 0.80
dimensions_sizeMethod · 0.80
LayoutClass · 0.70
IsArrayMethod · 0.45

Tested by

no test coverage detected