|
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( |
| 68 | + "acos", ti._acos_result_type, ti._acos, _acos_docstring |
| 69 | +) |
47 | 70 |
|
48 | 71 | # U03: ===== ACOSH (x)
|
49 |
| -# FIXME: implement U03 |
| 72 | +_acosh_docstring = """ |
| 73 | +acosh(x, out=None, order='K') |
| 74 | +
|
| 75 | +Computes inverse hyperbolic cosine for each element `x_i` for input array `x`. |
| 76 | +
|
| 77 | +Args: |
| 78 | + x (usm_ndarray): |
| 79 | + Input array, expected to have numeric data type. |
| 80 | + out ({None, usm_ndarray}, optional): |
| 81 | + Output array to populate. |
| 82 | + Array have the correct shape and the expected data type. |
| 83 | + order ("C","F","A","K", optional): |
| 84 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 85 | + Default: "K". |
| 86 | +Returns: |
| 87 | + usm_narray: |
| 88 | + An array containing the element-wise inverse hyperbolic cosine. |
| 89 | + The data type of the returned array is determined by |
| 90 | + the Type Promotion Rules. |
| 91 | +""" |
| 92 | + |
| 93 | +acosh = UnaryElementwiseFunc( |
| 94 | + "acosh", ti._acosh_result_type, ti._acosh, _acosh_docstring |
| 95 | +) |
50 | 96 |
|
51 | 97 | # B01: ===== ADD (x1, x2)
|
52 | 98 |
|
|
77 | 123 | )
|
78 | 124 |
|
79 | 125 | # U04: ===== ASIN (x)
|
80 |
| -# FIXME: implement U04 |
| 126 | +_asin_docstring = """ |
| 127 | +asin(x, out=None, order='K') |
| 128 | +
|
| 129 | +Computes inverse sine for each element `x_i` for input array `x`. |
| 130 | +
|
| 131 | +Args: |
| 132 | + x (usm_ndarray): |
| 133 | + Input array, expected to have numeric data type. |
| 134 | + out ({None, usm_ndarray}, optional): |
| 135 | + Output array to populate. |
| 136 | + Array have the correct shape and the expected data type. |
| 137 | + order ("C","F","A","K", optional): |
| 138 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 139 | + Default: "K". |
| 140 | +Returns: |
| 141 | + usm_narray: |
| 142 | + An array containing the element-wise inverse sine, in radians |
| 143 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 144 | + of the returned array is determined by the Type Promotion Rules. |
| 145 | +""" |
| 146 | + |
| 147 | +asin = UnaryElementwiseFunc( |
| 148 | + "asin", ti._asin_result_type, ti._asin, _asin_docstring |
| 149 | +) |
81 | 150 |
|
82 | 151 | # U05: ===== ASINH (x)
|
83 |
| -# FIXME: implement U05 |
| 152 | +_asinh_docstring = """ |
| 153 | +asinh(x, out=None, order='K') |
| 154 | +
|
| 155 | +Computes inverse hyperbolic sine for each element `x_i` for input array `x`. |
| 156 | +
|
| 157 | +Args: |
| 158 | + x (usm_ndarray): |
| 159 | + Input array, expected to have numeric data type. |
| 160 | + out ({None, usm_ndarray}, optional): |
| 161 | + Output array to populate. |
| 162 | + Array have the correct shape and the expected data type. |
| 163 | + order ("C","F","A","K", optional): |
| 164 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 165 | + Default: "K". |
| 166 | +Returns: |
| 167 | + usm_narray: |
| 168 | + An array containing the element-wise inverse hyperbolic sine. |
| 169 | + The data type of the returned array is determined by |
| 170 | + the Type Promotion Rules. |
| 171 | +""" |
| 172 | + |
| 173 | +asinh = UnaryElementwiseFunc( |
| 174 | + "asinh", ti._asinh_result_type, ti._asinh, _asinh_docstring |
| 175 | +) |
84 | 176 |
|
85 | 177 | # U06: ===== ATAN (x)
|
86 |
| -# FIXME: implement U06 |
| 178 | +_atan_docstring = """ |
| 179 | +atan(x, out=None, order='K') |
| 180 | +
|
| 181 | +Computes inverse tangent for each element `x_i` for input array `x`. |
| 182 | +
|
| 183 | +Args: |
| 184 | + x (usm_ndarray): |
| 185 | + Input array, expected to have numeric data type. |
| 186 | + out ({None, usm_ndarray}, optional): |
| 187 | + Output array to populate. |
| 188 | + Array have the correct shape and the expected data type. |
| 189 | + order ("C","F","A","K", optional): |
| 190 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 191 | + Default: "K". |
| 192 | +Returns: |
| 193 | + usm_narray: |
| 194 | + An array containing the element-wise inverse tangent, in radians |
| 195 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 196 | + of the returned array is determined by the Type Promotion Rules. |
| 197 | +""" |
| 198 | + |
| 199 | +atan = UnaryElementwiseFunc( |
| 200 | + "atan", ti._atan_result_type, ti._atan, _atan_docstring |
| 201 | +) |
87 | 202 |
|
88 | 203 | # B02: ===== ATAN2 (x1, x2)
|
89 | 204 | # FIXME: implemetn B02
|
90 | 205 |
|
91 | 206 | # U07: ===== ATANH (x)
|
92 |
| -# FIXME: implemetn U07 |
| 207 | +_atanh_docstring = """ |
| 208 | +atanh(x, out=None, order='K') |
| 209 | +
|
| 210 | +Computes hyperbolic inverse tangent for each element `x_i` for input array `x`. |
| 211 | +
|
| 212 | +Args: |
| 213 | + x (usm_ndarray): |
| 214 | + Input array, expected to have numeric data type. |
| 215 | + out ({None, usm_ndarray}, optional): |
| 216 | + Output array to populate. |
| 217 | + Array have the correct shape and the expected data type. |
| 218 | + order ("C","F","A","K", optional): |
| 219 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 220 | + Default: "K". |
| 221 | +Returns: |
| 222 | + usm_narray: |
| 223 | + An array containing the element-wise hyperbolic inverse tangent. |
| 224 | + The data type of the returned array is determined by |
| 225 | + the Type Promotion Rules. |
| 226 | +""" |
| 227 | + |
| 228 | +atanh = UnaryElementwiseFunc( |
| 229 | + "atanh", ti._atanh_result_type, ti._atanh, _atanh_docstring |
| 230 | +) |
93 | 231 |
|
94 | 232 | # B03: ===== BITWISE_AND (x1, x2)
|
95 | 233 | # FIXME: implemetn B03
|
|
161 | 299 | cos = UnaryElementwiseFunc("cos", ti._cos_result_type, ti._cos, _cos_docstring)
|
162 | 300 |
|
163 | 301 | # U12: ==== COSH (x)
|
164 |
| -# FIXME: implement U12 |
| 302 | +_cosh_docstring = """ |
| 303 | +cosh(x, out=None, order='K') |
| 304 | +
|
| 305 | +Computes hyperbolic cosine for each element `x_i` for input array `x`. |
| 306 | +
|
| 307 | +Args: |
| 308 | + x (usm_ndarray): |
| 309 | + Input array, expected to have numeric data type. |
| 310 | + out ({None, usm_ndarray}, optional): |
| 311 | + Output array to populate. |
| 312 | + Array have the correct shape and the expected data type. |
| 313 | + order ("C","F","A","K", optional): |
| 314 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 315 | + Default: "K". |
| 316 | +Returns: |
| 317 | + usm_narray: |
| 318 | + An array containing the element-wise hyperbolic cosine. The data type |
| 319 | + of the returned array is determined by the Type Promotion Rules. |
| 320 | +""" |
| 321 | + |
| 322 | +cosh = UnaryElementwiseFunc( |
| 323 | + "cosh", ti._cosh_result_type, ti._cosh, _cosh_docstring |
| 324 | +) |
165 | 325 |
|
166 | 326 | # B08: ==== DIVIDE (x1, x2)
|
167 | 327 | _divide_docstring_ = """
|
|
571 | 731 | sin = UnaryElementwiseFunc("sin", ti._sin_result_type, ti._sin, _sin_docstring)
|
572 | 732 |
|
573 | 733 | # U31: ==== SINH (x)
|
574 |
| -# FIXME: implement U31 |
| 734 | +_sinh_docstring = """ |
| 735 | +sinh(x, out=None, order='K') |
| 736 | +
|
| 737 | +Computes hyperbolic sine for each element `x_i` for input array `x`. |
| 738 | +
|
| 739 | +Args: |
| 740 | + x (usm_ndarray): |
| 741 | + Input array, expected to have numeric data type. |
| 742 | + out ({None, usm_ndarray}, optional): |
| 743 | + Output array to populate. |
| 744 | + Array have the correct shape and the expected data type. |
| 745 | + order ("C","F","A","K", optional): |
| 746 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 747 | + Default: "K". |
| 748 | +Returns: |
| 749 | + usm_narray: |
| 750 | + An array containing the element-wise hyperbolic sine. The data type |
| 751 | + of the returned array is determined by the Type Promotion Rules. |
| 752 | +""" |
| 753 | + |
| 754 | +sinh = UnaryElementwiseFunc( |
| 755 | + "sinh", ti._sinh_result_type, ti._sinh, _sinh_docstring |
| 756 | +) |
575 | 757 |
|
576 | 758 | # U32: ==== SQUARE (x)
|
577 | 759 | # FIXME: implement U32
|
|
631 | 813 |
|
632 | 814 |
|
633 | 815 | # U34: ==== TAN (x)
|
634 |
| -# FIXME: implement U34 |
| 816 | +_tan_docstring = """ |
| 817 | +tan(x, out=None, order='K') |
| 818 | +
|
| 819 | +Computes tangent for each element `x_i` for input array `x`. |
| 820 | +
|
| 821 | +Args: |
| 822 | + x (usm_ndarray): |
| 823 | + Input array, expected to have numeric data type. |
| 824 | + out ({None, usm_ndarray}, optional): |
| 825 | + Output array to populate. |
| 826 | + Array have the correct shape and the expected data type. |
| 827 | + order ("C","F","A","K", optional): |
| 828 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 829 | + Default: "K". |
| 830 | +Returns: |
| 831 | + usm_narray: |
| 832 | + An array containing the element-wise tangent. The data type |
| 833 | + of the returned array is determined by the Type Promotion Rules. |
| 834 | +""" |
| 835 | + |
| 836 | +tan = UnaryElementwiseFunc("tan", ti._tan_result_type, ti._tan, _tan_docstring) |
635 | 837 |
|
636 | 838 | # U35: ==== TANH (x)
|
637 |
| -# FIXME: implement U35 |
| 839 | +_tanh_docstring = """ |
| 840 | +tanh(x, out=None, order='K') |
| 841 | +
|
| 842 | +Computes hyperbolic tangent for each element `x_i` for input array `x`. |
| 843 | +
|
| 844 | +Args: |
| 845 | + x (usm_ndarray): |
| 846 | + Input array, expected to have numeric data type. |
| 847 | + out ({None, usm_ndarray}, optional): |
| 848 | + Output array to populate. |
| 849 | + Array have the correct shape and the expected data type. |
| 850 | + order ("C","F","A","K", optional): |
| 851 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 852 | + Default: "K". |
| 853 | +Returns: |
| 854 | + usm_narray: |
| 855 | + An array containing the element-wise hyperbolic tangent. The data type |
| 856 | + of the returned array is determined by the Type Promotion Rules. |
| 857 | +""" |
| 858 | + |
| 859 | +tanh = UnaryElementwiseFunc( |
| 860 | + "tanh", ti._tanh_result_type, ti._tanh, _tanh_docstring |
| 861 | +) |
638 | 862 |
|
639 | 863 | # U36: ==== TRUNC (x)
|
640 | 864 | # FIXME: implement U36
|
0 commit comments