static */
| 434 | } |
| 435 | |
| 436 | /* static */ int64 ShapeUtil::ElementsInRecursive(const Shape& shape) { |
| 437 | CHECK(shape.IsArray() || shape.IsTuple()); |
| 438 | if (shape.IsArray()) { |
| 439 | return ElementsIn(shape); |
| 440 | } |
| 441 | int64 count = 0; |
| 442 | for (const Shape& element_shape : shape.tuple_shapes()) { |
| 443 | count += ElementsInRecursive(element_shape); |
| 444 | } |
| 445 | return count; |
| 446 | } |
| 447 | |
| 448 | /* static */ bool ShapeUtil::HasPrimitiveType(const Shape& shape, |
| 449 | PrimitiveType primitive_type) { |
nothing calls this directly
no test coverage detected