提交 c0cfa4e3 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Better doc for diag().

上级 11ee6cee
...@@ -449,7 +449,10 @@ alloc_diag = AllocDiag() ...@@ -449,7 +449,10 @@ alloc_diag = AllocDiag()
def diag(x): def diag(x):
"""Numpy-compatibility method """Numpy-compatibility method
For vector `x`, return a zero matrix except for `x` as diagonal. If `x` is a matrix, return its diagonal.
If `x` is a vector return a matrix with it as its diagonal.
* This method does not support the `k` argument that numpy supports.
""" """
xx = as_tensor_variable(x) xx = as_tensor_variable(x)
if xx.type.ndim == 1: if xx.type.ndim == 1:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论