提交 b4dd3871 authored 作者: Frederic's avatar Frederic

add tensor.where as an alias for tensor.switch to support the same name as numpy.

上级 f0fdc95d
......@@ -986,6 +986,11 @@ Condition
x,y = T.dmatrices('x','y')
z = T.switch(T.lt(a,b), x, y)
.. function:: where(cond, ift, iff)
Alias for `switch`. where is the numpy name.
.. function:: clip(x, min, max)
Return a variable representing x, but with all elements greater than
......
......@@ -2605,11 +2605,11 @@ def isinf(a):
# Condition
##########################
@_scal_elemwise
@_scal_elemwise_with_nfunc('where', 3, 1)
def switch(cond, ift, iff):
"""if cond then ift else iff"""
where = switch
##########################
# Bit-wise
##########################
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论