| 1061 | } |
| 1062 | |
| 1063 | void ToStringHelper(const LiteralBase& literal, const ShapeIndex& shape_index, |
| 1064 | bool print_shape, bool print_layout, |
| 1065 | std::vector<string>* pieces) { |
| 1066 | const Shape& subshape = ShapeUtil::GetSubshape(literal.shape(), shape_index); |
| 1067 | CHECK(LayoutUtil::HasLayout(literal.shape())); |
| 1068 | CHECK(LayoutUtil::HasLayout(subshape)); |
| 1069 | if (subshape.IsTuple()) { |
| 1070 | TupleToStringHelper(literal, shape_index, print_shape, print_layout, |
| 1071 | pieces); |
| 1072 | } else if (subshape.IsToken()) { |
| 1073 | pieces->push_back("token"); |
| 1074 | } else { |
| 1075 | CHECK(LayoutUtil::IsDenseArray(subshape)); |
| 1076 | DenseArrayToStringHelper(literal, shape_index, print_shape, print_layout, |
| 1077 | pieces); |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | } // namespace |
| 1082 |
no test coverage detected