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

Method ToProto

tensorflow/compiler/xla/literal.cc:1964–1979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1962}
1963
1964LiteralProto LiteralBase::ToProto() const {
1965 LiteralProto proto;
1966 root_piece().ForEachSubpiece(
1967 [&](const ShapeIndex& index, const Piece& piece) {
1968 LiteralProto* proto_piece = &proto;
1969 for (int64 i : index) {
1970 while (proto_piece->tuple_literals_size() <= i) {
1971 proto_piece->add_tuple_literals();
1972 }
1973 proto_piece = proto_piece->mutable_tuple_literals(i);
1974 }
1975 piece.WriteToProto(proto_piece);
1976 });
1977
1978 return proto;
1979}
1980
1981const void* LiteralBase::untyped_data(const ShapeIndex& shape_index) const {
1982 return piece(shape_index).untyped_data();

Callers 1

WriteToProtoMethod · 0.45

Calls 2

ForEachSubpieceMethod · 0.80
WriteToProtoMethod · 0.80

Tested by

no test coverage detected