提交 76e66f80 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Add __str__ method to flatten Op

上级 fa4fc77d
...@@ -3660,6 +3660,8 @@ class Flatten(Op): ...@@ -3660,6 +3660,8 @@ class Flatten(Op):
return type(self) == type(other) and self.outdim == other.outdim return type(self) == type(other) and self.outdim == other.outdim
def __hash__(self): def __hash__(self):
return hashtype(self)^hash(self.outdim) return hashtype(self)^hash(self.outdim)
def __str__(self):
return '%s{%s}' % (self.__class__.__name__, self.outdim)
def make_node(self, x): def make_node(self, x):
t_x = as_tensor_variable(x) t_x = as_tensor_variable(x)
if self.outdim < 1 or (x.ndim and self.outdim > x.ndim): if self.outdim < 1 or (x.ndim and self.outdim > x.ndim):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论