Paddle python2中unicode string literal兼容

cuxqih21  于 2022-10-20  发布在  Python
关注(0)|答案(1)|浏览(150)

为了保证代码在python2/3环境下的兼容性。通常会在python2 中将所有字符串转为unicode处理。导致一下两处检查无法通过。

Paddle/python/paddle/fluid/transpiler/distribute_transpiler.py

Line 411 in 853f2e5

| | ifisinstance(trainers, str): |

Paddle/python/paddle/fluid/transpiler/distribute_transpiler.py

Line 599 in 853f2e5

| | assert (isinstance(trainers, str)) |

建议将此两处修改为.

isinstance(trainers, six.string_types):

相关问题