提交 280b9887 authored 作者: James Bergstra's avatar James Bergstra

finished renaming shape_padleft, added __hash__ to Split, matching OlivierDs __eq__

...@@ -1388,7 +1388,14 @@ class Split(Op): ...@@ -1388,7 +1388,14 @@ class Split(Op):
def __init__(self, len_splits): def __init__(self, len_splits):
self.len_splits = int(len_splits) self.len_splits = int(len_splits)
def __eq__(self, other):
return (type(self) == type(other) and
self.len_splits == other.len_splits)
def __hash__(self):
return 76612131345 ^ len(self.len_splits)
def make_node(self, x, axis, splits): def make_node(self, x, axis, splits):
"""WRITEME""" """WRITEME"""
x = as_tensor(x) x = as_tensor(x)
...@@ -1582,7 +1589,7 @@ def stack(*tensors): ...@@ -1582,7 +1589,7 @@ def stack(*tensors):
"""Insert the arguments as slices into a tensor of 1 rank greater. """Insert the arguments as slices into a tensor of 1 rank greater.
EXAMPLE EXAMPLE
""" """
return join(0, *[leftpad_shape(t, 1) for t in tensors]) return join(0, *[shape_padleft(t, 1) for t in tensors])
@constructor @constructor
def concatenate(tensor_list, axis=0): def concatenate(tensor_list, axis=0):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论