Squares each element of the input array, and returns the sum(s) of that. Parameters ---------- a : array_like Input array. axis : int or None, optional Axis along which to calculate. Default is 0. If None, compute over the whole array `a`. Returns
(a, axis=0)
| 475 | |
| 476 | |
| 477 | def _sum_of_squares(a, axis=0): |
| 478 | """ |
| 479 | Squares each element of the input array, and returns the sum(s) of that. |
| 480 | Parameters |
| 481 | ---------- |
| 482 | a : array_like |
| 483 | Input array. |
| 484 | axis : int or None, optional |
| 485 | Axis along which to calculate. Default is 0. If None, compute over |
| 486 | the whole array `a`. |
| 487 | Returns |
| 488 | ------- |
| 489 | sum_of_squares : ndarray |
| 490 | The sum along the given axis for (a**2). |
| 491 | See also |
| 492 | -------- |
| 493 | _square_of_sums : The square(s) of the sum(s) (the opposite of |
| 494 | `_sum_of_squares`). |
| 495 | """ |
| 496 | return da.sum(a * a, axis) |
| 497 | |
| 498 | |
| 499 | def _square_of_sums(a, axis=0): |