未验证 提交 3e3297c7 编写于 作者: H HydrogenSulfate 提交者: GitHub

fix jacobian and hessian's docstring (#53732)

* fix jacobian and hessian's docstring

* fix hessian's docstring

* fix hessian's docstring
上级 92db839f
...@@ -465,12 +465,12 @@ def jacobian( ...@@ -465,12 +465,12 @@ def jacobian(
The ``xs`` tuples are identical in one-to-one correspondence. The ``xs`` tuples are identical in one-to-one correspondence.
- When ``batch_axis=None``, only 0-dimensional Tensor or 1-dimensional Tensor is - When ``batch_axis=None``, only 0-dimensional Tensor or 1-dimensional Tensor is
supported, assuming the shape of ``xs`` is ``[N, ]``, the shape of ``ys`` is supported, assuming the shape of ``xs`` is ``[N, ]``, the shape of ``ys`` is
``[M, ]``, then the output Jacobian matrix shape is ``[M, N]``. ``[M, ]``, then the output Jacobian matrix shape is ``[M, N]``.
- When ``batch_axis=0``, only 1-dimensional Tensor or 2-dimensional Tensor is - When ``batch_axis=0``, only 1-dimensional Tensor or 2-dimensional Tensor is
supported, assuming the shape of ``xs`` is ``[B, N]``, The shape of ``ys`` is supported, assuming the shape of ``xs`` is ``[B, N]``, The shape of ``ys`` is
``[B, M]``, then the output Jacobian matrix shape is ``[B, M, N]``. ``[B, M]``, then the output Jacobian matrix shape is ``[B, M, N]``.
After the ``Jacobian`` object is created, the actual calculation process does not After the ``Jacobian`` object is created, the actual calculation process does not
occur, but the lazy evaluation method is used for calculation. It can be occur, but the lazy evaluation method is used for calculation. It can be
...@@ -553,15 +553,14 @@ def hessian( ...@@ -553,15 +553,14 @@ def hessian(
``batch_axis`` means The position of the batch dimension of the parameter data. ``batch_axis`` means The position of the batch dimension of the parameter data.
When the input ``xs`` is a Tensor tuple, the returned result is a ``Hessian`` tuple, When the input ``xs`` is a Tensor tuple, the returned result is a ``Hessian`` tuple,
assuming that the internal shape of the ``xs`` tuple is composed of assuming that the internal shape of the ``xs`` tuple is composed of ``([M1, ], [M2, ])``, the shape of the returned
``([M1, ], [M2, ]) ``, the shape of the returned result consists of result consists of ``(([M1, M1], [M1, M2]), ([M2, M1], [M2, M2]))``
``(([M1, M1], [M1, M2]), ([M2, M1], [M2, M2]))``
- When ``batch_axis=None``, only 0-dimensional Tensor or 1-dimensional Tensor is - When ``batch_axis=None``, only 0-dimensional Tensor or 1-dimensional Tensor is
supported, assuming that the shape of ``xs`` is ``[N, ]``, and the shape of ``ys`` is ``[ ]``(0-dimensional Tensor), the final output is a single Hessian matrix whose shape is ``[N, N]``. supported, assuming that the shape of ``xs`` is ``[N, ]``, and the shape of ``ys`` is ``[ ]`` (0-dimensional Tensor), the final output is a single Hessian matrix whose shape is ``[N, N]``.
- When ``batch_axis=0``, only 1-dimensional Tensor or 2-dimensional Tensor is - When ``batch_axis=0``, only 1-dimensional Tensor or 2-dimensional Tensor is
supported, assuming that the shape of ``xs`` is ``[B, N]``, and the shape of ``ys`` is `` [B, ]``, the final output Jacobian matrix shape is ``[B, N, N]``. supported, assuming that the shape of ``xs`` is ``[B, N]``, and the shape of ``ys`` is ``[B, ]``, the final output Jacobian matrix shape is ``[B, N, N]``.
After the ``Hessian`` object is created, the complete calculation process does not After the ``Hessian`` object is created, the complete calculation process does not
occur, but a partial lazy evaluation method is used for calculation. It can be occur, but a partial lazy evaluation method is used for calculation. It can be
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册