|
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 |
|
|
81 | 127 | )
|
82 | 128 |
|
83 | 129 | # U04: ===== ASIN (x)
|
84 |
| -# FIXME: implement U04 |
| 130 | +_asin_docstring = """ |
| 131 | +asin(x, out=None, order='K') |
| 132 | +
|
| 133 | +Computes inverse sine for each element `x_i` for input array `x`. |
| 134 | +
|
| 135 | +Args: |
| 136 | + x (usm_ndarray): |
| 137 | + Input array, expected to have numeric data type. |
| 138 | + out ({None, usm_ndarray}, optional): |
| 139 | + Output array to populate. |
| 140 | + Array have the correct shape and the expected data type. |
| 141 | + order ("C","F","A","K", optional): |
| 142 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 143 | + Default: "K". |
| 144 | +Returns: |
| 145 | + usm_narray: |
| 146 | + An array containing the element-wise inverse sine, in radians |
| 147 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 148 | + of the returned array is determined by the Type Promotion Rules. |
| 149 | +""" |
| 150 | + |
| 151 | +asin = UnaryElementwiseFunc( |
| 152 | + "asin", ti._asin_result_type, ti._asin, _asin_docstring |
| 153 | +) |
85 | 154 |
|
86 | 155 | # U05: ===== ASINH (x)
|
87 |
| -# FIXME: implement U05 |
| 156 | +_asinh_docstring = """ |
| 157 | +asinh(x, out=None, order='K') |
| 158 | +
|
| 159 | +Computes inverse hyperbolic sine for each element `x_i` for input array `x`. |
| 160 | +
|
| 161 | +Args: |
| 162 | + x (usm_ndarray): |
| 163 | + Input array, expected to have numeric data type. |
| 164 | + out ({None, usm_ndarray}, optional): |
| 165 | + Output array to populate. |
| 166 | + Array have the correct shape and the expected data type. |
| 167 | + order ("C","F","A","K", optional): |
| 168 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 169 | + Default: "K". |
| 170 | +Returns: |
| 171 | + usm_narray: |
| 172 | + An array containing the element-wise inverse hyperbolic sine. |
| 173 | + The data type of the returned array is determined by |
| 174 | + the Type Promotion Rules. |
| 175 | +""" |
| 176 | + |
| 177 | +asinh = UnaryElementwiseFunc( |
| 178 | + "asinh", ti._asinh_result_type, ti._asinh, _asinh_docstring |
| 179 | +) |
88 | 180 |
|
89 | 181 | # U06: ===== ATAN (x)
|
90 |
| -# FIXME: implement U06 |
| 182 | +_atan_docstring = """ |
| 183 | +atan(x, out=None, order='K') |
| 184 | +
|
| 185 | +Computes inverse tangent for each element `x_i` for input array `x`. |
| 186 | +
|
| 187 | +Args: |
| 188 | + x (usm_ndarray): |
| 189 | + Input array, expected to have numeric data type. |
| 190 | + out ({None, usm_ndarray}, optional): |
| 191 | + Output array to populate. |
| 192 | + Array have the correct shape and the expected data type. |
| 193 | + order ("C","F","A","K", optional): |
| 194 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 195 | + Default: "K". |
| 196 | +Returns: |
| 197 | + usm_narray: |
| 198 | + An array containing the element-wise inverse tangent, in radians |
| 199 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 200 | + of the returned array is determined by the Type Promotion Rules. |
| 201 | +""" |
| 202 | + |
| 203 | +atan = UnaryElementwiseFunc( |
| 204 | + "atan", ti._atan_result_type, ti._atan, _atan_docstring |
| 205 | +) |
91 | 206 |
|
92 | 207 | # B02: ===== ATAN2 (x1, x2)
|
93 | 208 | # FIXME: implemetn B02
|
94 | 209 |
|
95 | 210 | # U07: ===== ATANH (x)
|
96 |
| -# FIXME: implemetn U07 |
| 211 | +_atanh_docstring = """ |
| 212 | +atanh(x, out=None, order='K') |
| 213 | +
|
| 214 | +Computes hyperbolic inverse tangent for each element `x_i` for input array `x`. |
| 215 | +
|
| 216 | +Args: |
| 217 | + x (usm_ndarray): |
| 218 | + Input array, expected to have numeric data type. |
| 219 | + out ({None, usm_ndarray}, optional): |
| 220 | + Output array to populate. |
| 221 | + Array have the correct shape and the expected data type. |
| 222 | + order ("C","F","A","K", optional): |
| 223 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 224 | + Default: "K". |
| 225 | +Returns: |
| 226 | + usm_narray: |
| 227 | + An array containing the element-wise hyperbolic inverse tangent. |
| 228 | + The data type of the returned array is determined by |
| 229 | + the Type Promotion Rules. |
| 230 | +""" |
| 231 | + |
| 232 | +atanh = UnaryElementwiseFunc( |
| 233 | + "atanh", ti._atanh_result_type, ti._atanh, _atanh_docstring |
| 234 | +) |
97 | 235 |
|
98 | 236 | # B03: ===== BITWISE_AND (x1, x2)
|
99 | 237 | # FIXME: implemetn B03
|
|
165 | 303 | cos = UnaryElementwiseFunc("cos", ti._cos_result_type, ti._cos, _cos_docstring)
|
166 | 304 |
|
167 | 305 | # U12: ==== COSH (x)
|
168 |
| -# FIXME: implement U12 |
| 306 | +_cosh_docstring = """ |
| 307 | +cosh(x, out=None, order='K') |
| 308 | +
|
| 309 | +Computes hyperbolic cosine for each element `x_i` for input array `x`. |
| 310 | +
|
| 311 | +Args: |
| 312 | + x (usm_ndarray): |
| 313 | + Input array, expected to have numeric data type. |
| 314 | + out ({None, usm_ndarray}, optional): |
| 315 | + Output array to populate. |
| 316 | + Array have the correct shape and the expected data type. |
| 317 | + order ("C","F","A","K", optional): |
| 318 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 319 | + Default: "K". |
| 320 | +Returns: |
| 321 | + usm_narray: |
| 322 | + An array containing the element-wise hyperbolic cosine. The data type |
| 323 | + of the returned array is determined by the Type Promotion Rules. |
| 324 | +""" |
| 325 | + |
| 326 | +cosh = UnaryElementwiseFunc( |
| 327 | + "cosh", ti._cosh_result_type, ti._cosh, _cosh_docstring |
| 328 | +) |
169 | 329 |
|
170 | 330 | # B08: ==== DIVIDE (x1, x2)
|
171 | 331 | _divide_docstring_ = """
|
|
939 | 1099 | sin = UnaryElementwiseFunc("sin", ti._sin_result_type, ti._sin, _sin_docstring)
|
940 | 1100 |
|
941 | 1101 | # U31: ==== SINH (x)
|
942 |
| -# FIXME: implement U31 |
| 1102 | +_sinh_docstring = """ |
| 1103 | +sinh(x, out=None, order='K') |
| 1104 | +
|
| 1105 | +Computes hyperbolic sine for each element `x_i` for input array `x`. |
| 1106 | +
|
| 1107 | +Args: |
| 1108 | + x (usm_ndarray): |
| 1109 | + Input array, expected to have numeric data type. |
| 1110 | + out ({None, usm_ndarray}, optional): |
| 1111 | + Output array to populate. |
| 1112 | + Array have the correct shape and the expected data type. |
| 1113 | + order ("C","F","A","K", optional): |
| 1114 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1115 | + Default: "K". |
| 1116 | +Returns: |
| 1117 | + usm_narray: |
| 1118 | + An array containing the element-wise hyperbolic sine. The data type |
| 1119 | + of the returned array is determined by the Type Promotion Rules. |
| 1120 | +""" |
| 1121 | + |
| 1122 | +sinh = UnaryElementwiseFunc( |
| 1123 | + "sinh", ti._sinh_result_type, ti._sinh, _sinh_docstring |
| 1124 | +) |
943 | 1125 |
|
944 | 1126 | # U32: ==== SQUARE (x)
|
945 | 1127 | _square_docstring_ = """
|
|
1025 | 1207 |
|
1026 | 1208 |
|
1027 | 1209 | # U34: ==== TAN (x)
|
1028 |
| -# FIXME: implement U34 |
| 1210 | +_tan_docstring = """ |
| 1211 | +tan(x, out=None, order='K') |
| 1212 | +
|
| 1213 | +Computes tangent for each element `x_i` for input array `x`. |
| 1214 | +
|
| 1215 | +Args: |
| 1216 | + x (usm_ndarray): |
| 1217 | + Input array, expected to have numeric data type. |
| 1218 | + out ({None, usm_ndarray}, optional): |
| 1219 | + Output array to populate. |
| 1220 | + Array have the correct shape and the expected data type. |
| 1221 | + order ("C","F","A","K", optional): |
| 1222 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1223 | + Default: "K". |
| 1224 | +Returns: |
| 1225 | + usm_narray: |
| 1226 | + An array containing the element-wise tangent. The data type |
| 1227 | + of the returned array is determined by the Type Promotion Rules. |
| 1228 | +""" |
| 1229 | + |
| 1230 | +tan = UnaryElementwiseFunc("tan", ti._tan_result_type, ti._tan, _tan_docstring) |
1029 | 1231 |
|
1030 | 1232 | # U35: ==== TANH (x)
|
1031 |
| -# FIXME: implement U35 |
| 1233 | +_tanh_docstring = """ |
| 1234 | +tanh(x, out=None, order='K') |
| 1235 | +
|
| 1236 | +Computes hyperbolic tangent for each element `x_i` for input array `x`. |
| 1237 | +
|
| 1238 | +Args: |
| 1239 | + x (usm_ndarray): |
| 1240 | + Input array, expected to have numeric data type. |
| 1241 | + out ({None, usm_ndarray}, optional): |
| 1242 | + Output array to populate. |
| 1243 | + Array have the correct shape and the expected data type. |
| 1244 | + order ("C","F","A","K", optional): |
| 1245 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1246 | + Default: "K". |
| 1247 | +Returns: |
| 1248 | + usm_narray: |
| 1249 | + An array containing the element-wise hyperbolic tangent. The data type |
| 1250 | + of the returned array is determined by the Type Promotion Rules. |
| 1251 | +""" |
| 1252 | + |
| 1253 | +tanh = UnaryElementwiseFunc( |
| 1254 | + "tanh", ti._tanh_result_type, ti._tanh, _tanh_docstring |
| 1255 | +) |
1032 | 1256 |
|
1033 | 1257 | # U36: ==== TRUNC (x)
|
1034 | 1258 | # FIXME: implement U36
|
0 commit comments