aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/mpi_collectives
diff options
context:
space:
mode:
authorGravatar Yifei Feng <yifeif@google.com>2018-01-25 12:02:36 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-25 12:07:22 -0800
commit351c0a533a111636333b4ebeede16485cf679ca9 (patch)
treea0786bc9a8fe7432d69d8095b10586e3ef515b93 /tensorflow/contrib/mpi_collectives
parenta8c4e8d96de7c0978851a5f9718bbd6b8056d862 (diff)
Add C0330 bad-continuation check to pylint.
PiperOrigin-RevId: 183270896
Diffstat (limited to 'tensorflow/contrib/mpi_collectives')
-rw-r--r--tensorflow/contrib/mpi_collectives/mpi_ops.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/tensorflow/contrib/mpi_collectives/mpi_ops.py b/tensorflow/contrib/mpi_collectives/mpi_ops.py
index 81567cc688..bd7096d9ce 100644
--- a/tensorflow/contrib/mpi_collectives/mpi_ops.py
+++ b/tensorflow/contrib/mpi_collectives/mpi_ops.py
@@ -46,17 +46,16 @@ def _load_library(name, op_list=None):
if lib_op.name == expected_op:
break
else:
- raise NameError(
- 'Could not find operator %s in dynamic library %s' %
- (expected_op, name))
+ raise NameError('Could not find operator %s in dynamic library %s' %
+ (expected_op, name))
return library
except errors.NotFoundError:
logging.warning('%s file could not be loaded.', name)
-MPI_LIB = _load_library('mpi_collectives.so', ['MPISize', 'MPIRank',
- 'MPILocalRank', 'MPIAllgather',
- 'MPIAllreduce'])
+MPI_LIB = _load_library(
+ 'mpi_collectives.so',
+ ['MPISize', 'MPIRank', 'MPILocalRank', 'MPIAllgather', 'MPIAllreduce'])
def size(name=None):
@@ -151,15 +150,14 @@ def allgather(tensor, name=None):
"""
# Specify that first allgather is to collect the tensor gather sizes,
# indicated by passing in a scalar (0-D tensor) of value 0
- sizes_flag = tf.constant(0, dtype=tf.int64, name="size_flag_const")
- my_size = tf.slice(tf.shape(tensor, out_type=tf.int64), [0], [1], name="size_slice")
+ sizes_flag = tf.constant(0, dtype=tf.int64, name='size_flag_const')
+ my_size = tf.slice(
+ tf.shape(tensor, out_type=tf.int64), [0], [1], name='size_slice')
if name is None:
- name = "allgather"
- sizing_name = "{}_sizing".format(name)
+ name = 'allgather'
+ sizing_name = '{}_sizing'.format(name)
sizes = MPI_LIB.mpi_allgather(my_size, sizes_flag, name=sizing_name)
return MPI_LIB.mpi_allgather(tensor, sizes, name=name)
ops.NotDifferentiable('MPIAllgather')
-
-