|
43 | 43 | abs = UnaryElementwiseFunc("abs", ti._abs_result_type, ti._abs, _abs_docstring_)
|
44 | 44 |
|
45 | 45 | # U02: ==== ACOS (x)
|
46 |
| -# FIXME: implement U02 |
| 46 | +_acos_docstring = """ |
| 47 | +acos(x, out=None, order='K') |
| 48 | +
|
| 49 | +Computes inverse cosine for each element `x_i` for input array `x`. |
| 50 | +
|
| 51 | +Args: |
| 52 | + x (usm_ndarray): |
| 53 | + Input array, expected to have numeric data type. |
| 54 | + out ({None, usm_ndarray}, optional): |
| 55 | + Output array to populate. |
| 56 | + Array have the correct shape and the expected data type. |
| 57 | + order ("C","F","A","K", optional): |
| 58 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 59 | + Default: "K". |
| 60 | +Returns: |
| 61 | + usm_narray: |
| 62 | + An array containing the element-wise inverse cosine, in radians |
| 63 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 64 | + of the returned array is determined by the Type Promotion Rules. |
| 65 | +""" |
| 66 | + |
| 67 | +acos = UnaryElementwiseFunc("acos", ti._acos_result_type, ti._acos, _acos_docstring) |
47 | 68 |
|
48 | 69 | # U03: ===== ACOSH (x)
|
49 |
| -# FIXME: implement U03 |
| 70 | +_acosh_docstring = """ |
| 71 | +acosh(x, out=None, order='K') |
| 72 | +
|
| 73 | +Computes inverse hyperbolic cosine for each element `x_i` for input array `x`. |
| 74 | +
|
| 75 | +Args: |
| 76 | + x (usm_ndarray): |
| 77 | + Input array, expected to have numeric data type. |
| 78 | + out ({None, usm_ndarray}, optional): |
| 79 | + Output array to populate. |
| 80 | + Array have the correct shape and the expected data type. |
| 81 | + order ("C","F","A","K", optional): |
| 82 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 83 | + Default: "K". |
| 84 | +Returns: |
| 85 | + usm_narray: |
| 86 | + An array containing the element-wise inverse hyperbolic cosine. |
| 87 | + The data type of the returned array is determined by |
| 88 | + the Type Promotion Rules. |
| 89 | +""" |
| 90 | + |
| 91 | +acosh = UnaryElementwiseFunc("acosh", ti._acosh_result_type, ti._acosh, _acosh_docstring) |
50 | 92 |
|
51 | 93 | # B01: ===== ADD (x1, x2)
|
52 | 94 |
|
|
77 | 119 | )
|
78 | 120 |
|
79 | 121 | # U04: ===== ASIN (x)
|
80 |
| -# FIXME: implement U04 |
| 122 | +_asin_docstring = """ |
| 123 | +asin(x, out=None, order='K') |
| 124 | +
|
| 125 | +Computes inverse sine for each element `x_i` for input array `x`. |
| 126 | +
|
| 127 | +Args: |
| 128 | + x (usm_ndarray): |
| 129 | + Input array, expected to have numeric data type. |
| 130 | + out ({None, usm_ndarray}, optional): |
| 131 | + Output array to populate. |
| 132 | + Array have the correct shape and the expected data type. |
| 133 | + order ("C","F","A","K", optional): |
| 134 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 135 | + Default: "K". |
| 136 | +Returns: |
| 137 | + usm_narray: |
| 138 | + An array containing the element-wise inverse sine, in radians |
| 139 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 140 | + of the returned array is determined by the Type Promotion Rules. |
| 141 | +""" |
| 142 | + |
| 143 | +asin = UnaryElementwiseFunc("asin", ti._asin_result_type, ti._asin, _asin_docstring) |
81 | 144 |
|
82 | 145 | # U05: ===== ASINH (x)
|
83 |
| -# FIXME: implement U05 |
| 146 | +_asinh_docstring = """ |
| 147 | +asinh(x, out=None, order='K') |
| 148 | +
|
| 149 | +Computes inverse hyperbolic sine for each element `x_i` for input array `x`. |
| 150 | +
|
| 151 | +Args: |
| 152 | + x (usm_ndarray): |
| 153 | + Input array, expected to have numeric data type. |
| 154 | + out ({None, usm_ndarray}, optional): |
| 155 | + Output array to populate. |
| 156 | + Array have the correct shape and the expected data type. |
| 157 | + order ("C","F","A","K", optional): |
| 158 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 159 | + Default: "K". |
| 160 | +Returns: |
| 161 | + usm_narray: |
| 162 | + An array containing the element-wise inverse hyperbolic sine. |
| 163 | + The data type of the returned array is determined by |
| 164 | + the Type Promotion Rules. |
| 165 | +""" |
| 166 | + |
| 167 | +asinh = UnaryElementwiseFunc("asinh", ti._asinh_result_type, ti._asinh, _asinh_docstring) |
84 | 168 |
|
85 | 169 | # U06: ===== ATAN (x)
|
86 |
| -# FIXME: implement U06 |
| 170 | +_atan_docstring = """ |
| 171 | +atan(x, out=None, order='K') |
| 172 | +
|
| 173 | +Computes inverse tangent for each element `x_i` for input array `x`. |
| 174 | +
|
| 175 | +Args: |
| 176 | + x (usm_ndarray): |
| 177 | + Input array, expected to have numeric data type. |
| 178 | + out ({None, usm_ndarray}, optional): |
| 179 | + Output array to populate. |
| 180 | + Array have the correct shape and the expected data type. |
| 181 | + order ("C","F","A","K", optional): |
| 182 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 183 | + Default: "K". |
| 184 | +Returns: |
| 185 | + usm_narray: |
| 186 | + An array containing the element-wise inverse tangent, in radians |
| 187 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 188 | + of the returned array is determined by the Type Promotion Rules. |
| 189 | +""" |
| 190 | + |
| 191 | +atan = UnaryElementwiseFunc("atan", ti._atan_result_type, ti._atan, _atan_docstring) |
87 | 192 |
|
88 | 193 | # B02: ===== ATAN2 (x1, x2)
|
89 | 194 | # FIXME: implemetn B02
|
90 | 195 |
|
91 | 196 | # U07: ===== ATANH (x)
|
92 |
| -# FIXME: implemetn U07 |
| 197 | +_atanh_docstring = """ |
| 198 | +atanh(x, out=None, order='K') |
| 199 | +
|
| 200 | +Computes hyperbolic inverse tangent for each element `x_i` for input array `x`. |
| 201 | +
|
| 202 | +Args: |
| 203 | + x (usm_ndarray): |
| 204 | + Input array, expected to have numeric data type. |
| 205 | + out ({None, usm_ndarray}, optional): |
| 206 | + Output array to populate. |
| 207 | + Array have the correct shape and the expected data type. |
| 208 | + order ("C","F","A","K", optional): |
| 209 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 210 | + Default: "K". |
| 211 | +Returns: |
| 212 | + usm_narray: |
| 213 | + An array containing the element-wise hyperbolic inverse tangent. |
| 214 | + The data type of the returned array is determined by |
| 215 | + the Type Promotion Rules. |
| 216 | +""" |
| 217 | + |
| 218 | +atanh = UnaryElementwiseFunc("atanh", ti._atanh_result_type, ti._atanh, _atanh_docstring) |
93 | 219 |
|
94 | 220 | # B03: ===== BITWISE_AND (x1, x2)
|
95 | 221 | # FIXME: implemetn B03
|
|
161 | 287 | cos = UnaryElementwiseFunc("cos", ti._cos_result_type, ti._cos, _cos_docstring)
|
162 | 288 |
|
163 | 289 | # U12: ==== COSH (x)
|
164 |
| -# FIXME: implement U12 |
| 290 | +_cosh_docstring = """ |
| 291 | +cosh(x, out=None, order='K') |
| 292 | +
|
| 293 | +Computes hyperbolic cosine for each element `x_i` for input array `x`. |
| 294 | +
|
| 295 | +Args: |
| 296 | + x (usm_ndarray): |
| 297 | + Input array, expected to have numeric data type. |
| 298 | + out ({None, usm_ndarray}, optional): |
| 299 | + Output array to populate. |
| 300 | + Array have the correct shape and the expected data type. |
| 301 | + order ("C","F","A","K", optional): |
| 302 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 303 | + Default: "K". |
| 304 | +Returns: |
| 305 | + usm_narray: |
| 306 | + An array containing the element-wise hyperbolic cosine. The data type |
| 307 | + of the returned array is determined by the Type Promotion Rules. |
| 308 | +""" |
| 309 | + |
| 310 | +cosh = UnaryElementwiseFunc("cosh", ti._cosh_result_type, ti._cosh, _cosh_docstring) |
165 | 311 |
|
166 | 312 | # B08: ==== DIVIDE (x1, x2)
|
167 | 313 | _divide_docstring_ = """
|
|
571 | 717 | sin = UnaryElementwiseFunc("sin", ti._sin_result_type, ti._sin, _sin_docstring)
|
572 | 718 |
|
573 | 719 | # U31: ==== SINH (x)
|
574 |
| -# FIXME: implement U31 |
| 720 | +_sinh_docstring = """ |
| 721 | +sinh(x, out=None, order='K') |
| 722 | +
|
| 723 | +Computes hyperbolic sine for each element `x_i` for input array `x`. |
| 724 | +
|
| 725 | +Args: |
| 726 | + x (usm_ndarray): |
| 727 | + Input array, expected to have numeric data type. |
| 728 | + out ({None, usm_ndarray}, optional): |
| 729 | + Output array to populate. |
| 730 | + Array have the correct shape and the expected data type. |
| 731 | + order ("C","F","A","K", optional): |
| 732 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 733 | + Default: "K". |
| 734 | +Returns: |
| 735 | + usm_narray: |
| 736 | + An array containing the element-wise hyperbolic sine. The data type |
| 737 | + of the returned array is determined by the Type Promotion Rules. |
| 738 | +""" |
| 739 | + |
| 740 | +sinh = UnaryElementwiseFunc("sinh", ti._sinh_result_type, ti._sinh, _sinh_docstring) |
575 | 741 |
|
576 | 742 | # U32: ==== SQUARE (x)
|
577 | 743 | # FIXME: implement U32
|
|
631 | 797 |
|
632 | 798 |
|
633 | 799 | # U34: ==== TAN (x)
|
634 |
| -# FIXME: implement U34 |
| 800 | +_tan_docstring = """ |
| 801 | +tan(x, out=None, order='K') |
| 802 | +
|
| 803 | +Computes tangent for each element `x_i` for input array `x`. |
| 804 | +
|
| 805 | +Args: |
| 806 | + x (usm_ndarray): |
| 807 | + Input array, expected to have numeric data type. |
| 808 | + out ({None, usm_ndarray}, optional): |
| 809 | + Output array to populate. |
| 810 | + Array have the correct shape and the expected data type. |
| 811 | + order ("C","F","A","K", optional): |
| 812 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 813 | + Default: "K". |
| 814 | +Returns: |
| 815 | + usm_narray: |
| 816 | + An array containing the element-wise tangent. The data type |
| 817 | + of the returned array is determined by the Type Promotion Rules. |
| 818 | +""" |
| 819 | + |
| 820 | +tan = UnaryElementwiseFunc("tan", ti._tan_result_type, ti._tan, _tan_docstring) |
635 | 821 |
|
636 | 822 | # U35: ==== TANH (x)
|
637 |
| -# FIXME: implement U35 |
| 823 | +_tanh_docstring = """ |
| 824 | +tanh(x, out=None, order='K') |
| 825 | +
|
| 826 | +Computes hyperbolic tangent for each element `x_i` for input array `x`. |
| 827 | +
|
| 828 | +Args: |
| 829 | + x (usm_ndarray): |
| 830 | + Input array, expected to have numeric data type. |
| 831 | + out ({None, usm_ndarray}, optional): |
| 832 | + Output array to populate. |
| 833 | + Array have the correct shape and the expected data type. |
| 834 | + order ("C","F","A","K", optional): |
| 835 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 836 | + Default: "K". |
| 837 | +Returns: |
| 838 | + usm_narray: |
| 839 | + An array containing the element-wise hyperbolic tangent. The data type |
| 840 | + of the returned array is determined by the Type Promotion Rules. |
| 841 | +""" |
| 842 | + |
| 843 | +tanh = UnaryElementwiseFunc("tanh", ti._tanh_result_type, ti._tanh, _tanh_docstring) |
638 | 844 |
|
639 | 845 | # U36: ==== TRUNC (x)
|
640 | 846 | # FIXME: implement U36
|
0 commit comments