tf.cumsum / tf.cumprod with a negative axis return a tensor of shape [undefined, ...] (cpu) or crash (wasm)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, typescript, wasm
- Área
- backend, machine-learning
Línea de trabajo
Empieza por tfjs-core/src/ops/cumsum.ts y cumprod.ts; después, inspecciona los kernels de CPU y WASM que pasan [axis] a getAxesPermutation. Compara cómo normalizan los ejes otras ops con parseAxisParam y revisa las pruebas existentes para la suma y el producto acumulativos. El trabajo estará terminado cuando un eje negativo produzca resultados equivalentes a los del eje positivo correspondiente en ambos backends o genere un error de validación claro.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Please make sure that this is a bug. As per our
GitHub Policy,
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux x86_64 (Debian 12)
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: n/a
- TensorFlow.js installed from (npm or script link): npm
- TensorFlow.js version (use command below): @tensorflow/tfjs-core, @tensorflow/tfjs-backend-cpu, @tensorflow/tfjs-backend-wasm 4.22.0 (master 7f5309fe unchanged), Node.js v26.13.0
- Browser version: n/a
- Tensorflow.js Converter Version: n/a
Describe the current behavior
tf.cumsum(x, -1) and tf.cumprod(x, -1) do not normalize or validate a negative axis. On the cpu backend, the returned tensor has shape [undefined, 2] and empty data []. On the wasm backend, the call aborts with RuntimeError: memory access out of bounds inside Module._free. Most other tfjs ops accept negative axes via parseAxisParam, as does TensorFlow's tf.math.cumsum.
Describe the expected behavior
Compute the cumulative sum or product along the last axis ([[1, 3, 6], [4, 9, 15]] for the example below, matching tf.cumsum(x, 1)), or throw a validation error if negative axes are not supported.
Standalone code to reproduce the issue
const tf = require("@tensorflow/tfjs-core");
require("@tensorflow/tfjs-backend-cpu");
require("@tensorflow/tfjs-backend-wasm");
(async () => {
await tf.setBackend(process.argv[2]);
const x = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);
const y = tf.cumsum(x, -1);
console.log(y.shape, Array.from(y.dataSync()));
})();
$ node cumsum.js cpu
[ undefined, 2 ] []
$ node cumsum.js wasm
RuntimeError: memory access out of bounds
Other info / logs
tfjs-core/src/ops/cumsum.ts and cumprod.ts pass axis directly to the kernel without calling parseAxisParam, and the cpu and wasm kernels pass [axis] directly to getAxesPermutation([axis], rank).
Credit: https://ucsbplse.github.io/
- Lenguaje dominante
- TypeScript
- Estrellas
- 19.2k
- Forks
- 2k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de tensorflow/tfjs
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
tensorflow/tfjs#8753 ·
-
Review argparse dependency bringing in sprintf-js CVE-2026-97058Posiblemente ocupada @Varun-S10 la tomó hace 19 días. Abiertotype:others
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
tensorflow/tfjs#8749 · 1 asignado ·
-
`@tensorflow/tfjs-node` installation issueQuizá libre de nuevo @nileshau-afk la tomó hace 29 días y no hay ningún pull request abierto. Abiertotype:build/install
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
tensorflow/tfjs#8748 · 1 asignado ·
-
The package tfjs-node is not working in version 26.8.1 of NodeQuizá libre de nuevo @nileshau-afk la tomó hace 57 días y no hay ningún pull request abierto. Abiertocomp:node.js type:bug
tensorflow/tfjs#8746 · 4 comentarios · 1 reacción · 1 asignado ·
-
I'm getting these npm errors while trying to install @tensorflow/tfjs-nodeQuizá libre de nuevo @Varun-S10 la tomó hace 87 días y no hay ningún pull request abierto. Abiertostat:awaiting tensorflower type:build/install type:support
tensorflow/tfjs#8740 · 4 comentarios · 1 reacción · 1 asignado ·
Todos los issues de tensorflow/tfjs
Issues similares
-
content triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
tool-submission
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
BraveOPotato/NoSignups#2348 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
code-yeongyu/oh-my-openagent#12784 ·
Los mantenedores suelen responder en 1 día
-
external-issue to-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 71/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
MomsBloomOrg/momsbloom-resources#84 ·
Los mantenedores suelen responder en 1 día