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

Function TupleToStringHelper

tensorflow/compiler/xla/literal.cc:972–988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970 std::vector<string>* pieces);
971
972void TupleToStringHelper(const LiteralBase& literal,
973 const ShapeIndex& shape_index, bool print_shape,
974 bool print_layout, std::vector<string>* pieces) {
975 const Shape& subshape = ShapeUtil::GetSubshape(literal.shape(), shape_index);
976 pieces->push_back("(\n");
977 std::vector<string> tuple_pieces;
978 for (int i = 0; i < ShapeUtil::TupleElementCount(subshape); ++i) {
979 ShapeIndex element_index = shape_index;
980 element_index.push_back(i);
981 std::vector<string> element_pieces;
982 ToStringHelper(literal, element_index, print_shape, print_layout,
983 &element_pieces);
984 tuple_pieces.push_back(absl::StrJoin(element_pieces, ""));
985 }
986 pieces->push_back(absl::StrJoin(tuple_pieces, ",\n"));
987 pieces->push_back("\n)");
988}
989
990void DenseArrayToStringHelper(const LiteralBase& literal,
991 const ShapeIndex& shape_index, bool print_shape,

Callers 1

ToStringHelperFunction · 0.85

Calls 3

ToStringHelperFunction · 0.85
shapeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected