提交 aadd0e99 authored 作者: Matthew Rocklin's avatar Matthew Rocklin

PEP8 changes in tensor/io

上级 91a34f8e
...@@ -49,8 +49,7 @@ class LoadFromDisk(Op): ...@@ -49,8 +49,7 @@ class LoadFromDisk(Op):
out[0][0] = result out[0][0] = result
def __str__(self): def __str__(self):
return "Load{dtype:%s, broadcastable:%s, mmep:%s}" % self._info return "Load{dtype: %s, broadcastable: %s, mmep: %s}" % self._info
def load(path, dtype, broadcastable, mmap_mode=None): def load(path, dtype, broadcastable, mmap_mode=None):
""" """
...@@ -129,7 +128,7 @@ class MPIRecv(Op): ...@@ -129,7 +128,7 @@ class MPIRecv(Op):
out[1][0] = data out[1][0] = data
def __str__(self): def __str__(self):
return "MPIRecv{source: %d, tag: %d, shape: %s, dtype: %s}"%self._info return "MPIRecv{source: %d, tag: %d, shape: %s, dtype: %s}" % self._info
def infer_shape(self, node, shapes): def infer_shape(self, node, shapes):
return [None, self.shape] return [None, self.shape]
...@@ -212,7 +211,7 @@ class MPISend(Op): ...@@ -212,7 +211,7 @@ class MPISend(Op):
out[0][0] = request out[0][0] = request
def __str__(self): def __str__(self):
return "MPISend{dest: %d, tag: %d}"%self._info return "MPISend{dest: %d, tag: %d}" % self._info
class MPISendWait(Op): class MPISendWait(Op):
""" """
...@@ -247,11 +246,13 @@ class MPISendWait(Op): ...@@ -247,11 +246,13 @@ class MPISendWait(Op):
def isend(var, dest, tag): def isend(var, dest, tag):
return MPISend(dest, tag)(var) return MPISend(dest, tag)(var)
def send(var, dest, tag): def send(var, dest, tag):
return MPISendWait(tag)(isend(var, dest, tag)) return MPISendWait(tag)(isend(var, dest, tag))
def irecv(shape, dtype, source, tag): def irecv(shape, dtype, source, tag):
return MPIRecv(source, tag, shape, dtype)() return MPIRecv(source, tag, shape, dtype)()
def recv(shape, dtype, source, tag): def recv(shape, dtype, source, tag):
return MPIRecvWait(tag)(*irecv(shape, dtype, source, tag)) return MPIRecvWait(tag)(*irecv(shape, dtype, source, tag))
......
...@@ -61,7 +61,7 @@ def test_mpi_tag_ordering(): ...@@ -61,7 +61,7 @@ def test_mpi_tag_ordering():
nodes = f.maker.linker.make_all()[-1] nodes = f.maker.linker.make_all()[-1]
assert all(node.op.tag == tag assert all(node.op.tag == tag
for node, tag in zip(nodes, (11,12,13,11,12,13))) for node, tag in zip(nodes, (11, 12, 13, 11, 12, 13)))
def test_mpi_schedule(): def test_mpi_schedule():
x = theano.tensor.matrix('x') x = theano.tensor.matrix('x')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论