MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _debug_string_

Function _debug_string_

python/paddle/base/framework.py:1551–1568  ·  view source on GitHub ↗

Get the debug string of a protobuf message. The message could be not initialized. Args: proto(google.protobuf.message.Message): The protobuf message throw_on_error(bool): True if raise an error when the protobuf message is not initialized. Returns(str):

(proto, throw_on_error=True)

Source from the content-addressed store, hash-verified

1549
1550
1551def _debug_string_(proto, throw_on_error=True):
1552 """
1553 Get the debug string of a protobuf message. The message could be not
1554 initialized.
1555 Args:
1556 proto(google.protobuf.message.Message): The protobuf message
1557 throw_on_error(bool): True if raise an error when the protobuf message
1558 is not initialized.
1559
1560 Returns(str): The debug string of the protobuf message
1561
1562 """
1563 error_fields = []
1564 if not proto.IsInitialized(error_fields) and throw_on_error:
1565 raise ValueError(
1566 f"{error_fields} are not initialized.\nThe message is {proto}:\n"
1567 )
1568 return proto.__str__()
1569
1570
1571def _create_tensor(

Callers 4

to_stringMethod · 0.85
to_stringMethod · 0.85
to_stringMethod · 0.85
to_stringMethod · 0.85

Calls 3

ValueErrorClass · 0.85
IsInitializedMethod · 0.45
__str__Method · 0.45

Tested by

no test coverage detected