提交 7c9a605b authored 作者: Frederic Bastien's avatar Frederic Bastien

better docstring/error message

上级 6cbfa5ba
...@@ -5100,8 +5100,9 @@ def flatten(x, ndim=None, outdim=None): ...@@ -5100,8 +5100,9 @@ def flatten(x, ndim=None, outdim=None):
ndim : int ndim : int
the number of dimensions of the returned variable the number of dimensions of the returned variable
Default 1.
outdim : int outdim : int
DEPRECATED synonyme for ndim DEPRECATED synonym for ndim
Returns Returns
------- -------
theano.tensor.var.TensorVariable theano.tensor.var.TensorVariable
...@@ -5110,10 +5111,10 @@ def flatten(x, ndim=None, outdim=None): ...@@ -5110,10 +5111,10 @@ def flatten(x, ndim=None, outdim=None):
if outdim is None and ndim is None: if outdim is None and ndim is None:
ndim = 1 ndim = 1
elif outdim is not None and ndim is not None: elif outdim is not None and ndim is not None:
raise ValueError("You should only specify outdim or ndim") raise ValueError("You should only specify ndim")
elif outdim is not None: elif outdim is not None:
warnings.warn( warnings.warn(
"flatten outdim parmaeter is deprecated, use ndim instead.") "flatten outdim parameter is deprecated, use ndim instead.")
ndim = outdim ndim = outdim
# Any input variable can be flattened to have ndim of 1, # Any input variable can be flattened to have ndim of 1,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论