Gets the sum of all the entries in this tensor.
178939
public double getSum() {
        double sum = s.zero();
        for (int c = 0; c < this.values.length; c++) {
            sum = s.plus(sum, values[c]);
        }
        return sum;
    }
673216
def sum(self):
        
        return NumpyArrayWeld(
            numpy_weld_impl.aggr(
                self.expr,
                "+",
                0,
                self.weld_type
            ),
            self.weld_type,
            0
        )
1074861
public static double sum(DoubleVector v) {
        double sum = 0;
        if (v instanceof SparseVector) {
            for (int nz : ((SparseVector)v).getNonZeroIndices())
                sum += v.get(nz);
        }
        else {
            int len = v.length();
            for (int i = 0; i < len; ++i)
                sum += v.get(i);
        }
        return sum;
    }
1164346
def sum(self, vector):
        """"""
        return self.from_list(
            [x + vector.vector[i] for i, x in self.to_list()]
        )
348541
def sum_coefs(self):
        """"""
        return numpy.sum(self.ar_coefs) + numpy.sum(self.ma_coefs)
1142084
public static int sum( GrayS32 img ) {

		if( BoofConcurrency.USE_CONCURRENT ) {
			return ImplImageStatistics_MT.sum(img);
		} else {
			return ImplImageStatistics.sum(img);
		}
	}
1301965
def sum_all(iterable, start):
    
    if hasattr(start, "__add__"):
        for value in iterable:
            start += value
    else:
        for value in iterable:
            start |= value
    return start
1315289
function() {
			var i = this.stack.length,
				total = 0;

			while ( i-- ) {
				total += this.stack[ i ].inputs;
			}
			return total;
		}
1219800
def get(self):
        
        if self.num is None:
            if self.num_inst == 0:
                return (self.name, float('nan'))
            else:
                return (self.name, self.sum_metric / self.num_inst)
        else:
            names = ['%s'%(self.name[i]) for i in range(self.num)]
            values = [x / y if y != 0 else float('nan') \
                for x, y in zip(self.sum_metric, self.num_inst)]
            return (names, values)
324049
public static int sum( GrayU16 img ) {

		if( BoofConcurrency.USE_CONCURRENT ) {
			return ImplImageStatistics_MT.sum(img);
		} else {
			return ImplImageStatistics.sum(img);
		}
	}
553348
def share(self):
        
        tot = sum(self.total.values())
        return { k: v/float(tot) for k,v in self.total.items() }
1328709
function sum() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
        }
        var sum = 0;
        if (args.length > 0) {
            args.map(function (number) {
                if (isNumber(number)) {
                    sum += number;
                }
            });
        }
        return sum;
    }
1261144
def sum(self, default=None):
        
        return numpy.asscalar(numpy.sum(self.values)) if self.values else default
1071252
private void computeSumItemSizes() {
        for (int d = 0; d < nbDims; d++) {
            long sum = 0;
            for (int i = 0; i < iSizes[d].length; i++) {
                sum += iSizes[d][i];
            }
            this.sumISizes[d] = sum;
        }

    }
116729
public double sum() {
        double sum = 0;
        for (WeightedDirectedTypedEdge<T> e : inEdges.values())
            sum += e.weight();
        for (WeightedDirectedTypedEdge<T> e : outEdges.values())
            sum += e.weight();
        return sum;
    }
1270377
public double sum() {
        double sum = 0;
        TIntDoubleIterator iter = edges.iterator();
        while (iter.hasNext()) {
            iter.advance();
            sum += iter.value();
        }
        return sum;
    }
815663
public synchronized int getActualTotal(T actual) {
        if (!matrix.containsKey(actual)) {
            return 0;
        } else {
            int total = 0;
            for (T elem : matrix.get(actual).elementSet()) {
                total += matrix.get(actual).count(elem);
            }
            return total;
        }
    }