From b9bb6fe72f93399b7a34aa11ab89c23635b87e6f Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Fri, 12 May 2023 11:50:07 +0800 Subject: [PATCH] fix hessian's docstring (#53740) --- python/paddle/autograd/autograd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/autograd/autograd.py b/python/paddle/autograd/autograd.py index c30bd56a2ce..e61a7ff0092 100644 --- a/python/paddle/autograd/autograd.py +++ b/python/paddle/autograd/autograd.py @@ -553,14 +553,14 @@ def hessian( ``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, - assuming that the internal shape of the ``xs`` tuple is composed of ``([M1, ], [M2, ]) ``, the shape of the returned + assuming that the internal shape of the ``xs`` tuple is composed of ``([M1, ], [M2, ])``, the shape of the returned result consists of ``(([M1, M1], [M1, M2]), ([M2, M1], [M2, M2]))`` - 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]``. - 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 occur, but a partial lazy evaluation method is used for calculation. It can be -- GitLab