| 482 | |
| 483 | template <typename T> |
| 484 | ShapeTree<T>::ShapeTree(Shape shape) |
| 485 | : shape_storage_(std::make_shared<Shape>(std::move(shape))), |
| 486 | shape_(shape_storage_.get()) { |
| 487 | const int64 count = CountSubshapes(*shape_); |
| 488 | nodes_.reserve(count); |
| 489 | nodes_.emplace_back(ShapeIndex{}); |
| 490 | |
| 491 | index_table_.reserve(count); |
| 492 | index_table_.emplace_back(Index{0, 1}); |
| 493 | InitChildren(*shape_, &nodes_[0], &index_table_[0]); |
| 494 | } |
| 495 | |
| 496 | template <typename T> |
| 497 | ShapeTree<T>::ShapeTree(const Shape* shape) : shape_(shape) { |
nothing calls this directly
no test coverage detected