| 397 | |
| 398 | template <typename T> |
| 399 | int64 ShapeTree<T>::CountSubshapes(const Shape& shape) { |
| 400 | int64 current_count = 1; |
| 401 | if (shape.IsTuple()) { |
| 402 | int64 count = ShapeUtil::TupleElementCount(shape); |
| 403 | for (int i = 0; i < count; ++i) { |
| 404 | current_count += CountSubshapes(shape.tuple_shapes(i)); |
| 405 | } |
| 406 | } |
| 407 | return current_count; |
| 408 | } |
| 409 | |
| 410 | template <typename T> |
| 411 | void ShapeTree<T>::InitChildren(const Shape& shape, const T& init_value, |
nothing calls this directly
no test coverage detected