MCPcopy Create free account
hub / github.com/apache/tvm / sum

Function sum

python/tvm/topi/reduction.py:45–67  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

43
44
45def 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
70def all(data, axis=None, keepdims=False):

Callers 15

num_cutlass_partitionsFunction · 0.50
_eval_offsetFunction · 0.50
_shape_perm_for_isolatedFunction · 0.50
_outer_offsetsFunction · 0.50
_outer_const_offsetsFunction · 0.50
_analyze_shuffle_reduceFunction · 0.50
_cubic_kernelFunction · 0.50
_resize_1dFunction · 0.50
_resize_2dFunction · 0.50
_resize_3dFunction · 0.50
lrn_pythonFunction · 0.50
test_attentionFunction · 0.50

Calls 1

sumMethod · 0.45

Tested by 14

test_attentionFunction · 0.40
get_top_kMethod · 0.40
get_top_kMethod · 0.40
_checkFunction · 0.40
_checkFunction · 0.40
offset_generaterFunction · 0.40
_np_layout_offsetFunction · 0.40
py_outer_dsFunction · 0.40
test_warp_sum_partial_8Function · 0.40
test_warp_sum_all_widthsFunction · 0.40