Skip to content

Commit

Permalink
fix _message of protobuf (#49673)
Browse files Browse the repository at this point in the history
  • Loading branch information
risemeup1 authored Feb 21, 2023
1 parent b39afb1 commit 7fe44fe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/paddle/distributed/fleet/base/distributed_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
from paddle.fluid.framework import _global_flags
from paddle.fluid.wrapped_decorator import wrap_decorator

protobuf_version = google.protobuf.__version__
if protobuf_version >= "4.21.0":
import google._upb._message as _message
else:
import google.protobuf.pyext._message as _message

__all__ = []

non_auto_func_called = True
Expand Down Expand Up @@ -2497,7 +2503,7 @@ def __repr__(self):
for ff in config_fields:
if isinstance(
getattr(my_configs, ff.name),
google.protobuf.pyext._message.RepeatedScalarContainer,
_message.RepeatedScalarContainer,
):
values = getattr(my_configs, ff.name)
for i, v in enumerate(values):
Expand Down

0 comments on commit 7fe44fe

Please sign in to comment.