static */
| 621 | } |
| 622 | |
| 623 | /* static */ int64 ShapeUtil::ByteSizeOf(const Shape& shape, |
| 624 | int64 pointer_size) { |
| 625 | TF_DCHECK_OK(ValidateShape(shape)); |
| 626 | if (shape.element_type() == TUPLE) { |
| 627 | return ByteSizeOfTupleIndexTable(shape, pointer_size); |
| 628 | } else if (shape.IsArray()) { |
| 629 | int64 byte_size = ByteSizeOfElements(shape); |
| 630 | return byte_size; |
| 631 | } else if (shape.element_type() == TOKEN) { |
| 632 | return 0; |
| 633 | } else if (shape.element_type() == OPAQUE_TYPE) { |
| 634 | CHECK_GT(pointer_size, 0); |
| 635 | return pointer_size; |
| 636 | } |
| 637 | LOG(FATAL) << PrimitiveType_Name(shape.element_type()) |
| 638 | << " primitive type has no definitive size"; |
| 639 | } |
| 640 | |
| 641 | /* static */ int64 ShapeUtil::ByteSizeOfTupleIndexTable(const Shape& shape, |
| 642 | int64 pointer_size) { |
nothing calls this directly
no test coverage detected