MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ToStringHelper

Function ToStringHelper

tensorflow/compiler/xla/literal.cc:1063–1079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1061}
1062
1063void 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

Callers 6

TupleToStringHelperFunction · 0.85
ToStringMethod · 0.85
ToStringWithoutShapeMethod · 0.85
ToStringWithLayoutMethod · 0.85
ToStringMethod · 0.85
ToStringMethod · 0.85

Calls 6

TupleToStringHelperFunction · 0.85
DenseArrayToStringHelperFunction · 0.85
IsTokenMethod · 0.80
shapeMethod · 0.45
IsTupleMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected