Skip to content

Commit

Permalink
[Typing][A-13] Add type annotations for paddle/tensor/to_string.py (P…
Browse files Browse the repository at this point in the history
  • Loading branch information
gouzil authored Jun 12, 2024
1 parent abfab42 commit c2438a0
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions python/paddle/tensor/to_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import numpy as np

import paddle
Expand All @@ -34,20 +36,20 @@ class PrintOptions:


def set_printoptions(
precision=None,
threshold=None,
edgeitems=None,
sci_mode=None,
linewidth=None,
):
precision: int | None = None,
threshold: int | None = None,
edgeitems: int | None = None,
sci_mode: bool | None = None,
linewidth: int | None = None,
) -> None:
"""Set the printing options for Tensor.
Args:
precision (int, optional): Number of digits of the floating number, default 8.
threshold (int, optional): Total number of elements printed, default 1000.
edgeitems (int, optional): Number of elements in summary at the beginning and ending of each dimension, default 3.
sci_mode (bool, optional): Format the floating number with scientific notation or not, default False.
linewidth (int, optional): Number of characters each line, default 80.
precision (int|None, optional): Number of digits of the floating number, default 8.
threshold (int|None, optional): Total number of elements printed, default 1000.
edgeitems (int|None, optional): Number of elements in summary at the beginning and ending of each dimension, default 3.
sci_mode (bool|None, optional): Format the floating number with scientific notation or not, default False.
linewidth (int|None, optional): Number of characters each line, default 80.
Returns:
Expand Down

0 comments on commit c2438a0

Please sign in to comment.