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

Function CreateDefaultLayoutForRank

tensorflow/compiler/xla/layout_util.cc:100–107  ·  view source on GitHub ↗

Internal helper that creates a default layout for an array of the given rank.

Source from the content-addressed store, hash-verified

98
99// Internal helper that creates a default layout for an array of the given rank.
100Layout CreateDefaultLayoutForRank(int64 rank) {
101 Layout layout;
102 layout.set_format(DENSE);
103 auto* minor_to_major = layout.mutable_minor_to_major();
104 minor_to_major->resize(rank, 0);
105 SetDefaultLayoutToContainer(minor_to_major);
106 return layout;
107}
108
109} // namespace
110

Callers 5

GetDefaultLayoutForR2Method · 0.85
GetDefaultLayoutForR3Method · 0.85
GetDefaultLayoutForR4Method · 0.85

Calls 3

resizeMethod · 0.45

Tested by

no test coverage detected