{"record":{"id":"96bbba4f07f77cc7","repo":"tracel-ai/burn","slug":"int-gather-nd-is-not-implemented-for-this-backend","errorCode":null,"errorMessage":"int_gather_nd is not implemented for this backend","messagePattern":"int_gather_nd is not implemented for this backend","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-backend/src/backend/ops/int_tensor.rs","lineNumber":214,"sourceCode":"        tensor: IntTensor<B>,\n        indices: IntTensor<B>,\n        value: IntTensor<B>,\n        update: IndexingUpdateOp,\n    ) -> IntTensor<B>;\n\n    /// Multi-dimensional scatter for int tensors.\n    fn int_scatter_nd(\n        _data: IntTensor<B>,\n        _indices: IntTensor<B>,\n        _values: IntTensor<B>,\n        _reduction: crate::tensor::IndexingUpdateOp,\n    ) -> IntTensor<B> {\n        unimplemented!(\"int_scatter_nd is not implemented for this backend\")\n    }\n\n    /// Multi-dimensional gather for int tensors.\n    fn int_gather_nd(_data: IntTensor<B>, _indices: IntTensor<B>) -> IntTensor<B> {\n        unimplemented!(\"int_gather_nd is not implemented for this backend\")\n    }\n\n    /// Select tensor elements along the given dimension corresponding to the given indices.\n    ///\n    /// # Arguments\n    ///\n    /// * `tensor` - The tensor.\n    /// * `dim` - The dimension to select from.\n    /// * `indices` - The indices.\n    ///\n    /// # Returns\n    ///\n    /// The tensor with the selected elements.\n    fn int_select(tensor: IntTensor<B>, dim: usize, indices: IntTensor<B>) -> IntTensor<B>;\n\n    /// Assign selected elements along a dimension using the specified update operation.\n    fn int_select_assign(\n        tensor: IntTensor<B>,","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-backend/src/backend/ops/int_tensor.rs#L196-L232","documentation":"`int_gather_nd` is a default trait method for multi-dimensional gather on int tensors; its default body panics with `unimplemented!(\"int_gather_nd is not implemented for this backend\")`. The backend in use has not overridden this op.","triggerScenarios":"Calling `int_gather_nd(data, indices)` (GatherNd-style indexing on Int tensors) on a backend lacking the override.","commonSituations":"ONNX `GatherNd` on integer tensors; embedding/index lookups ported from other frameworks to a minimal backend.","solutions":["Switch to a backend that implements `int_gather_nd`.","Implement `int_gather_nd` in your backend (e.g. compute flat indices and use `int_select`).","Rewrite the gather using supported select/gather primitives via index math (last-dim size factorization)."],"exampleFix":"// before\nlet out = B::int_gather_nd(data, indices); // panics\n\n// after\n// compute flat indices then use supported select:\nlet flat_idx = compute_flat_indices(indices, data.shape());\nlet out = B::int_select(flat_data, flat_idx);","handlingStrategy":"fallback","validationCode":"// Probe gather_nd support or restrict model export to ops the target backend supports","typeGuard":null,"tryCatchPattern":"let out = std::panic::catch_unwind(|| B::int_gather_nd(d, i))\n    .unwrap_or_else(|_| gather_nd_via_flat_select(d, i));","preventionTips":["Run model-level op-coverage tests per backend before deployment.","Keep a portable gather_nd implementation built from select/reshape as a fallback.","Track backend feature matrices when porting ONNX/TF graphs."],"tags":["rust","gather","int-tensor","unimplemented-stub"],"backgroundTag":"backend-method-unimplemented","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}