Fix pylint (#7241)

This commit is contained in:
Jiaming Yuan
2021-09-17 11:50:36 +08:00
committed by GitHub
parent 38a23f66a8
commit b18f5f61b0
9 changed files with 80 additions and 71 deletions

View File

@@ -185,7 +185,7 @@ def allreduce(data, op, prepare_fun=None):
if buf.base is data.base:
buf = buf.copy()
if buf.dtype not in DTYPE_ENUM__:
raise Exception('data type %s not supported' % str(buf.dtype))
raise Exception(f"data type {buf.dtype} not supported")
if prepare_fun is None:
_check_call(_LIB.RabitAllreduce(buf.ctypes.data_as(ctypes.c_void_p),
buf.size, DTYPE_ENUM__[buf.dtype],