提交 48263896 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Combine older and newer docstring

上级 fd698ba5
......@@ -4166,10 +4166,15 @@ register_canonicalize(local_reshape_chain(T.Reshape),
@gof.local_optimizer([T.Reshape])
def local_useless_reshape(node):
"""
Broadcastable dimensions in reshpae are replaced with dimshuffle.
Remove two kinds of useless reshape.
Remove Reshape when both the input and output have a single dimension.
Broadcastable dimensions in Reshape are replaced with dimshuffle.
For example:
- reshape(v, (m,)) --> v # if v.ndim == 1
- reshape(x, (1, n)) --> dimshuffle{x,0}(reshape(x, (n,))
- reshape(x, (1, m, 1, n, 1, 1)) --> dimshuffle{x,0,x,1,x,x}(reshape(x, (m, n)))
- reshape(x, (1, m, 1, n, 1, 1))
--> dimshuffle{x,0,x,1,x,x}(reshape(x, (m, n)))
"""
op = node.op
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论