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

Method MakeTupleOwned

tensorflow/compiler/xla/literal_util.cc:494–507  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

492}
493
494/* static */ Literal LiteralUtil::MakeTupleOwned(
495 std::vector<Literal> elements) {
496 std::vector<Shape> element_shapes;
497 element_shapes.reserve(elements.size());
498 for (const auto& element : elements) {
499 element_shapes.push_back(element.shape());
500 }
501 Literal literal(ShapeUtil::MakeTupleShape(element_shapes));
502 for (int64 i = 0; i < elements.size(); ++i) {
503 TF_CHECK_OK(
504 literal.MoveFrom(std::move(elements[i]), /*dest_shape_index=*/{i}));
505 }
506 return literal;
507}
508
509/* static */ string LiteralUtil::MultiIndexAsString(
510 absl::Span<const int64> multi_index) {

Callers

nothing calls this directly

Calls 5

reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
shapeMethod · 0.45
MoveFromMethod · 0.45

Tested by

no test coverage detected