提交 573689a8 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

Added props to MPISend and MPIRecv in theano/tensor/io.py

上级 273ccd4c
......@@ -103,6 +103,7 @@ class MPIRecv(Op):
@note: Non-differentiable.
"""
__props__ = ("source", "tag", "shape", "dtype")
def __init__(self, source, tag, shape, dtype):
self.source = source
......@@ -112,12 +113,6 @@ class MPIRecv(Op):
self.broadcastable = (False,) * len(shape)
self._info = (source, tag, shape, dtype)
def __eq__(self, other):
return (type(self) == type(other) and self._info == other._info)
def __hash__(self):
return hash((type(self),) + self._info)
def make_node(self):
return gof.Apply(self, [], [theano.Variable(Generic()),
tensor(self.dtype,
......@@ -185,18 +180,13 @@ class MPISend(Op):
@note: Non-differentiable.
"""
__props__ = ("dest", "tag")
def __init__(self, dest, tag):
self.dest = dest
self.tag = tag
self._info = (dest, tag)
def __eq__(self, other):
return (type(self) == type(other) and self._info == other._info)
def __hash__(self):
return hash((type(self),) + self._info)
def make_node(self, data):
return gof.Apply(self, [data],
[theano.Variable(Generic()), data.type()])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论