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

Function AssignLayout

tensorflow/compiler/tf2xla/shape_util.cc:71–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71Status AssignLayout(
72 absl::Span<const int64> minor_to_major,
73 const std::function<xla::Layout(const xla::Shape&)>& layout_func,
74 xla::Shape* shape) {
75 xla::Layout layout;
76 TF_ASSIGN_OR_RETURN(bool has_layout, MakeLayout(minor_to_major, &layout));
77 if (!has_layout && layout_func) {
78 layout = layout_func(*shape);
79 }
80 *shape->mutable_layout() = layout;
81 return Status::OK();
82}
83
84} // namespace
85

Callers 1

GetShapeWithLayoutFunction · 0.85

Calls 1

mutable_layoutMethod · 0.80

Tested by

no test coverage detected