Skip to content

Commit de5763c

Browse files
committed
fix: replace policy string with policy object
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent cb86a56 commit de5763c

File tree

1 file changed

+5
-8
lines changed
  • lib/node_modules/@stdlib/blas/ext/sum/lib

1 file changed

+5
-8
lines changed

lib/node_modules/@stdlib/blas/ext/sum/lib/main.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,10 @@ var factory = require( '@stdlib/ndarray/base/unary-reduce-strided1d-dispatch-fac
3131

3232
var idtypes = dtypes( 'numeric_and_generic' );
3333
var odtypes = dtypes( 'numeric_and_generic' );
34-
35-
// FIXME: consider defining an "accumulation" policy so that small integer arrays do not readily overflow (see the Array API Standard; if changed, need to update the README accordingly)
36-
37-
// FIXME: may need to consider C arithmetic emulation, including for signed/unsigned integers, in order to ensure consistent results (currently, `gsum` accumulates in double-precision in JS; however, given that integer summation is modulo arithmetic, this may not be an issue, as the results may be the same)
38-
39-
// FIXME: per the Array API Standard, if the output dtype differs from the input dtype, the input ndarray should be cast prior to computation (ref: https://data-apis.org/array-api/latest/API_specification/generated/array_api.sum.html)
40-
var policy = 'same';
34+
var policies = {
35+
'output': 'accumulation',
36+
'casting': 'promoted'
37+
};
4138
var table = {
4239
'types': [
4340
'float64', // input
@@ -98,7 +95,7 @@ var table = {
9895
* var v = out.get();
9996
* // returns 39.0
10097
*/
101-
var sum = factory( table, [ idtypes ], odtypes, policy );
98+
var sum = factory( table, [ idtypes ], odtypes, policies );
10299

103100

104101
// EXPORTS //

0 commit comments

Comments
 (0)