Sum of array elements over a given axis or a list of axes Parameters ---------- data : tvm.te.Tensor The input tvm tensor axis : None or int or tuple of int Axis or axes along which a sum is performed. The default, axis=None, will sum all of the elements of
(data, axis=None, keepdims=False)
| 43 | |
| 44 | |
| 45 | def sum(data, axis=None, keepdims=False): |
| 46 | """Sum of array elements over a given axis or a list of axes |
| 47 | |
| 48 | Parameters |
| 49 | ---------- |
| 50 | data : tvm.te.Tensor |
| 51 | The input tvm tensor |
| 52 | |
| 53 | axis : None or int or tuple of int |
| 54 | Axis or axes along which a sum is performed. |
| 55 | The default, axis=None, will sum all of the elements of the input array. |
| 56 | If axis is negative it counts from the last to the first axis. |
| 57 | |
| 58 | keepdims : bool |
| 59 | If this is set to True, the axes which are reduced are left in the result as dimensions |
| 60 | with size one. |
| 61 | With this option, the result will broadcast correctly against the input array. |
| 62 | |
| 63 | Returns |
| 64 | ------- |
| 65 | ret : tvm.te.Tensor |
| 66 | """ |
| 67 | return cpp.sum(data, axis, keepdims) |
| 68 | |
| 69 | |
| 70 | def all(data, axis=None, keepdims=False): |