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

Method BuildPieceSubtree

tensorflow/compiler/xla/literal.cc:2104–2118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2102 : LiteralBase(), root_piece_(&literal.piece(view_root)) {}
2103
2104void BorrowingLiteral::BuildPieceSubtree(const Shape& shape, Piece* piece) {
2105 CHECK(shape.IsTuple());
2106 for (int i = 0; i < ShapeUtil::TupleElementCount(shape); ++i) {
2107 const Shape& subshape = shape.tuple_shapes(i);
2108
2109 auto child_piece = Piece();
2110 child_piece.set_subshape(&subshape);
2111
2112 if (subshape.IsTuple()) {
2113 BuildPieceSubtree(subshape, &child_piece);
2114 }
2115
2116 piece->emplace_back(std::move(child_piece));
2117 }
2118}
2119
2120BorrowingLiteral::BorrowingLiteral(const char* src_buf_ptr, const Shape& shape)
2121 : LiteralBase(), shape_(absl::make_unique<Shape>(shape)) {

Callers

nothing calls this directly

Calls 5

set_subshapeMethod · 0.80
PieceClass · 0.70
IsTupleMethod · 0.45
tuple_shapesMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected