Skip to content

Commit 4748233

Browse files
committed
Fixed docstrings for negative, positive, pow, and square
1 parent 602eef1 commit 4748233

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

dpctl/tensor/_elementwise_funcs.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@
718718
_negative_docstring_ = """
719719
negative(x, out=None, order='K')
720720
721-
Computes the numerical negative elementwise.
721+
Computes the numerical negative for each element `x_i` of input array `x`.
722722
Args:
723723
x (usm_ndarray):
724724
Input array, expected to have numeric data type.
@@ -730,7 +730,7 @@
730730
Default: "K".
731731
Return:
732732
usm_ndarray:
733-
An array containing the element-wise negative values.
733+
An array containing the negative of `x`.
734734
"""
735735

736736
negative = UnaryElementwiseFunc(
@@ -770,7 +770,7 @@
770770
_positive_docstring_ = """
771771
positive(x, out=None, order='K')
772772
773-
Computes the numerical positive element-wise.
773+
Computes the numerical positive for each element `x_i` of input array `x`.
774774
Args:
775775
x (usm_ndarray):
776776
Input array, expected to have numeric data type.
@@ -782,7 +782,7 @@
782782
Default: "K".
783783
Return:
784784
usm_ndarray:
785-
An array containing the element-wise positive values.
785+
An array containing the values of `x`.
786786
"""
787787

788788
positive = UnaryElementwiseFunc(
@@ -802,7 +802,7 @@
802802
x2 (usm_ndarray):
803803
Second input array, also expected to have a numeric data type.
804804
Returns:
805-
usm_narray:
805+
usm_ndarray:
806806
an array containing the element-wise result. The data type of
807807
the returned array is determined by the Type Promotion Rules.
808808
"""
@@ -899,7 +899,21 @@
899899
_square_docstring_ = """
900900
square(x, out=None, order='K')
901901
902-
Computes `x_i**2` for each element `x_i` for input array `x`.
902+
Computes `x_i**2` (or `x_i*x_i`) for each element `x_i` of input array `x`.
903+
Args:
904+
x (usm_ndarray):
905+
Input array, expected to have numeric data type.
906+
out ({None, usm_ndarray}, optional):
907+
Output array to populate.
908+
Array have the correct shape and the expected data type.
909+
order ("C","F","A","K", optional):
910+
Memory layout of the newly output array, if parameter `out` is `None`.
911+
Default: "K".
912+
Returns:
913+
usm_ndarray:
914+
An array containing the square `x`.
915+
The data type of the returned array is determined by
916+
the Type Promotion Rules.
903917
"""
904918

905919
square = UnaryElementwiseFunc(

0 commit comments

Comments
 (0)