提交 d117b248 authored 作者: Frederic Bastien's avatar Frederic Bastien

revert the bad change of max(,axis=None). I changed the behavior, but this must be warned before!.

上级 64a95964
...@@ -1408,8 +1408,11 @@ def max(x, axis=None): ...@@ -1408,8 +1408,11 @@ def max(x, axis=None):
Default axis is the last one. Default axis is the last one.
:note: we return an error as numpy when we reduce a dim with a shape of 0 :note: we return an error as numpy when we reduce a dim with a shape of 0
:note2: see MaxAndArgmax note for a difference between numpy and theano when axis==None
""" """
if isinstance(axis,int) or axis is None: if isinstance(axis,int) or axis is None or (isinstance(axis,(list,tuple)) and all([isinstance(i,int) for i in axis])):
if axis is None:
axis = len(x.type.broadcastable)
return CAReduce(scal.maximum,axis)(x) return CAReduce(scal.maximum,axis)(x)
#TODO: do CAReduce need axis to be constant? #TODO: do CAReduce need axis to be constant?
try: try:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论