static */
| 1344 | } |
| 1345 | |
| 1346 | /* static */ Literal MutableLiteralBase::MoveIntoTuple( |
| 1347 | absl::Span<Literal> elements) { |
| 1348 | std::vector<Shape> element_shapes; |
| 1349 | for (const Literal& element : elements) { |
| 1350 | element_shapes.push_back(element.shape()); |
| 1351 | } |
| 1352 | Literal literal(ShapeUtil::MakeTupleShape(element_shapes), |
| 1353 | /*allocate_arrays=*/false); |
| 1354 | for (int i = 0; i < elements.size(); ++i) { |
| 1355 | TF_CHECK_OK( |
| 1356 | literal.MoveFrom(std::move(elements[i]), /*dest_shape_index=*/{i})); |
| 1357 | } |
| 1358 | return literal; |
| 1359 | } |
| 1360 | |
| 1361 | template <typename NativeT> |
| 1362 | bool LiteralBase::Piece::EqualElementsInternal( |