Skip to content

Commit

Permalink
fix docstring
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Nov 12, 2024
1 parent b7d2b32 commit 201cf80
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions deepmd/dpmodel/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def cast_precision(func: Callable[..., Any]) -> Callable[..., Any]:
"""A decorator that casts and casts back the input
and output tensor of a method.
The decorator should be used in a classmethod.
The decorator should be used on an instance method.
The decorator will do the following thing:
(1) It casts input arrays from the global precision
Expand Down Expand Up @@ -201,17 +201,17 @@ def safe_cast_array(
Parameters
----------
input : tf.Tensor
Input tensor
input : np.ndarray or None
Input array
from_precision : str
Array data type that is casted from
to_precision : str
Array data type that casts to
Returns
-------
tf.Tensor
casted Tensor
np.ndarray or None
casted array
"""
if array_api_compat.is_array_api_obj(input):
xp = array_api_compat.array_namespace(input)
Expand Down

0 comments on commit 201cf80

Please sign in to comment.