@@ -774,8 +774,8 @@ def _get_accumulation_res_dt(a, dtype):
774
774
Returns
775
775
-------
776
776
out : dpnp.ndarray
777
- An array containing the element-wise cosine. The data type of the returned
778
- array is determined by the Type Promotion Rules.
777
+ An array containing the element-wise cosine, in radians . The data type of
778
+ the returned array is determined by the Type Promotion Rules.
779
779
780
780
Limitations
781
781
-----------
@@ -2269,8 +2269,8 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2269
2269
Returns
2270
2270
-------
2271
2271
out : dpnp.ndarray
2272
- An array containing the element-wise sine. The data type of the returned
2273
- array is determined by the Type Promotion Rules.
2272
+ An array containing the element-wise sine, in radians . The data type of the
2273
+ returned array is determined by the Type Promotion Rules.
2274
2274
2275
2275
Limitations
2276
2276
-----------
@@ -2441,14 +2441,14 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2441
2441
2442
2442
2443
2443
_SQUARE_DOCSTRING = r"""
2444
- Squares each element `x_i` of input array `x`.
2444
+ Squares each element :math: `x_i` of input array `x`.
2445
2445
2446
2446
For full documentation refer to :obj:`numpy.square`.
2447
2447
2448
2448
Parameters
2449
2449
----------
2450
2450
x : {dpnp.ndarray, usm_ndarray}
2451
- Input array.
2451
+ Input array, expected to have a boolean or numeric data type .
2452
2452
out : {None, dpnp.ndarray, usm_ndarray}, optional
2453
2453
Output array to populate.
2454
2454
Array must have the correct shape and the expected data type.
@@ -2462,8 +2462,8 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2462
2462
Returns
2463
2463
-------
2464
2464
out : dpnp.ndarray
2465
- An array containing the element-wise squares of `x`. The data type of
2466
- the returned array is determined by the Type Promotion Rules.
2465
+ An array containing the element-wise squares of `x`. The data type of the
2466
+ returned array is determined by the Type Promotion Rules.
2467
2467
2468
2468
Limitations
2469
2469
-----------
@@ -2473,11 +2473,11 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2473
2473
2474
2474
See Also
2475
2475
--------
2476
- :obj:`dpnp..linalg.matrix_power` : Raise a square matrix
2477
- to the (integer) power `n`.
2476
+ :obj:`dpnp..linalg.matrix_power` : Raise a square matrix to the (integer)
2477
+ power `n`.
2478
2478
:obj:`dpnp.sqrt` : Calculate :math:`\sqrt{x}`, element-wise.
2479
- :obj:`dpnp.power` : First array elements raised to powers
2480
- from second array, element-wise.
2479
+ :obj:`dpnp.power` : Exponentiation by raising the first array to the power of
2480
+ the second array, element-wise.
2481
2481
2482
2482
Examples
2483
2483
--------
@@ -2499,14 +2499,14 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2499
2499
2500
2500
2501
2501
_TAN_DOCSTRING = """
2502
- Computes tangent for each element `x_i` for input array `x`.
2502
+ Computes the tangent for each element :math: `x_i` for input array `x`.
2503
2503
2504
2504
For full documentation refer to :obj:`numpy.tan`.
2505
2505
2506
2506
Parameters
2507
2507
----------
2508
2508
x : {dpnp.ndarray, usm_ndarray}
2509
- Input array, expected to have numeric data type.
2509
+ Input array, expected to have a floating-point data type.
2510
2510
out : {None, dpnp.ndarray, usm_ndarray}, optional
2511
2511
Output array to populate.
2512
2512
Array must have the correct shape and the expected data type.
@@ -2520,8 +2520,8 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2520
2520
Returns
2521
2521
-------
2522
2522
out : dpnp.ndarray
2523
- An array containing the element-wise tangent. The data type
2524
- of the returned array is determined by the Type Promotion Rules.
2523
+ An array containing the element-wise tangent, in radians . The data type of
2524
+ the returned array is determined by the Type Promotion Rules.
2525
2525
2526
2526
Limitations
2527
2527
-----------
@@ -2531,7 +2531,7 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2531
2531
2532
2532
See Also
2533
2533
--------
2534
- :obj:`dpnp.arctan ` : Trigonometric inverse tangent, element-wise.
2534
+ :obj:`dpnp.atan ` : Trigonometric inverse tangent, element-wise.
2535
2535
:obj:`dpnp.sin` : Trigonometric sine, element-wise.
2536
2536
:obj:`dpnp.cos` : Trigonometric cosine, element-wise.
2537
2537
:obj:`dpnp.tanh` : Hyperbolic tangent, element-wise.
@@ -2555,15 +2555,21 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2555
2555
)
2556
2556
2557
2557
2558
- _TANH_DOCSTRING = """
2559
- Computes hyperbolic tangent for each element `x_i` for input array `x`.
2558
+ _TANH_DOCSTRING = r"""
2559
+ Computes the hyperbolic tangent for each element :math:`x_i` for input array
2560
+ `x`.
2561
+
2562
+ The mathematical definition of the hyperbolic tangent is
2563
+
2564
+ .. math::
2565
+ \operatorname{tanh}(x) = \frac{\operatorname{sinh}(x)}{\operatorname{cosh}(x)}
2560
2566
2561
2567
For full documentation refer to :obj:`numpy.tanh`.
2562
2568
2563
2569
Parameters
2564
2570
----------
2565
2571
x : {dpnp.ndarray, usm_ndarray}
2566
- Input array, expected to have numeric data type.
2572
+ Input array, expected to have a floating-point data type.
2567
2573
out : {None, dpnp.ndarray, usm_ndarray}, optional
2568
2574
Output array to populate.
2569
2575
Array must have the correct shape and the expected data type.
@@ -2577,8 +2583,8 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2577
2583
Returns
2578
2584
-------
2579
2585
out : dpnp.ndarray
2580
- An array containing the element-wise hyperbolic tangent. The data type
2581
- of the returned array is determined by the Type Promotion Rules.
2586
+ An array containing the element-wise hyperbolic tangent. The data type of
2587
+ the returned array is determined by the Type Promotion Rules.
2582
2588
2583
2589
Limitations
2584
2590
-----------
@@ -2588,7 +2594,7 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None):
2588
2594
2589
2595
See Also
2590
2596
--------
2591
- :obj:`dpnp.arctanh ` : Hyperbolic inverse tangent, element-wise.
2597
+ :obj:`dpnp.atanh ` : Hyperbolic inverse tangent, element-wise.
2592
2598
:obj:`dpnp.sinh` : Hyperbolic sine, element-wise.
2593
2599
:obj:`dpnp.cosh` : Hyperbolic cosine, element-wise.
2594
2600
:obj:`dpnp.tan` : Trigonometric tangent, element-wise.
@@ -2617,8 +2623,9 @@ def unwrap(p, discont=None, axis=-1, *, period=2 * dpnp.pi):
2617
2623
Unwrap by taking the complement of large deltas with respect to the period.
2618
2624
2619
2625
This unwraps a signal `p` by changing elements which have an absolute
2620
- difference from their predecessor of more than ``max(discont, period / 2)``
2621
- to their `period`-complementary values.
2626
+ difference from their predecessor of more than
2627
+ :math:`\max(discont, \frac{period}{2})` to their `period`-complementary
2628
+ values.
2622
2629
2623
2630
For the default case where `period` is :math:`2\pi` and `discont` is
2624
2631
:math:`\pi`, this unwraps a radian phase `p` such that adjacent differences
@@ -2633,16 +2640,19 @@ def unwrap(p, discont=None, axis=-1, *, period=2 * dpnp.pi):
2633
2640
Input array.
2634
2641
discont : {float, None}, optional
2635
2642
Maximum discontinuity between values, default is ``None`` which is an
2636
- alias for ``period / 2``. Values below ``period / 2`` are treated as if
2637
- they were ``period / 2``. To have an effect different from the default,
2638
- `discont` should be larger than ``period / 2``.
2643
+ alias for :math:`\frac{period}{2}`. Values below
2644
+ :math:`\frac{period}{2}` are treated as if they were
2645
+ :math:`\frac{period}{2}`. To have an effect different from the default,
2646
+ `discont` should be larger than :math:`\frac{period}{2}`.
2639
2647
2640
2648
Default: ``None``.
2641
2649
axis : int, optional
2642
2650
Axis along which unwrap will operate, default is the last axis.
2651
+
2643
2652
Default: ``-1``.
2644
2653
period : float, optional
2645
2654
Size of the range over which the input wraps.
2655
+
2646
2656
Default: ``2 * pi``.
2647
2657
2648
2658
Returns
@@ -2657,9 +2667,9 @@ def unwrap(p, discont=None, axis=-1, *, period=2 * dpnp.pi):
2657
2667
2658
2668
Notes
2659
2669
-----
2660
- If the discontinuity in `p` is smaller than `` period / 2`` , but larger than
2661
- `discont`, no unwrapping is done because taking the complement would only
2662
- make the discontinuity larger.
2670
+ If the discontinuity in `p` is smaller than :math:`\frac{ period}{2}` , but
2671
+ larger than `discont`, no unwrapping is done because taking the complement
2672
+ would only make the discontinuity larger.
2663
2673
2664
2674
Examples
2665
2675
--------
0 commit comments