コード例 #1
0
def zero_one(val):
    return 1.0 if is_nonzero(val) else 0.0
コード例 #2
0
def zero_one(val):
    return 1.0 if is_nonzero(val) else 0.0
コード例 #3
0
ファイル: subexpr_elim.py プロジェクト: arbenson/fast-matmul
def num_nonzero(coeffs):
    ''' Returns the total number of nonzero in the coefficients. '''
    return sum([1 for coeff_set in coeffs for coeff_line in coeff_set \
                  for coeff in coeff_line if gen.is_nonzero(coeff)])
コード例 #4
0
ファイル: subexpr_elim.py プロジェクト: timminn/fast-matmul
def num_nonzero(coeffs):
    ''' Returns the total number of nonzero in the coefficients. '''
    return sum([1 for coeff_set in coeffs for coeff_line in coeff_set \
                  for coeff in coeff_line if gen.is_nonzero(coeff)])