{"record":{"id":"1ebe02156e22c7d9","repo":"tracel-ai/burn","slug":"float-gather-nd-is-not-implemented-for-this-backen","errorCode":null,"errorMessage":"float_gather_nd is not implemented for this backend","messagePattern":"float_gather_nd is not implemented for this backend","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-backend/src/backend/ops/tensor.rs","lineNumber":526,"sourceCode":"        _indices: IntTensor<B>,\n        _values: FloatTensor<B>,\n        _reduction: crate::tensor::IndexingUpdateOp,\n    ) -> FloatTensor<B> {\n        unimplemented!(\"float_scatter_nd is not implemented for this backend\")\n    }\n\n    /// Multi-dimensional gather: collect slices from `data` at locations specified by `indices`.\n    ///\n    /// # Arguments\n    ///\n    /// * `data` - The tensor to gather from.\n    /// * `indices` - An M-dimensional integer tensor whose last dimension indexes into `data`.\n    ///\n    /// # Returns\n    ///\n    /// The gathered tensor.\n    fn float_gather_nd(_data: FloatTensor<B>, _indices: IntTensor<B>) -> FloatTensor<B> {\n        unimplemented!(\"float_gather_nd is not implemented for this backend\")\n    }\n\n    /// Select tensor elements along the given dimension corresponding for the given indices.\n    ///\n    /// # Arguments\n    ///\n    /// * `tensor` - The tensor to select from.\n    /// * `dim` - The dimension to select from.\n    /// * `indices` - The indices to select.\n    ///\n    /// # Returns\n    ///\n    /// The selected elements.\n    fn float_select(tensor: FloatTensor<B>, dim: usize, indices: IntTensor<B>) -> FloatTensor<B>;\n\n    /// Assign selected elements along a dimension using the specified update operation.\n    fn float_select_assign(\n        tensor: FloatTensor<B>,","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-backend/src/backend/ops/tensor.rs#L508-L544","documentation":"`float_gather_nd` is a default trait method for multi-dimensional gather on float tensors; its default body panics with `unimplemented!(\"float_gather_nd is not implemented for this backend\")`. The backend has not overridden this optional op.","triggerScenarios":"Calling `float_gather_nd(data, indices)` (GatherNd on Float tensors) on a backend lacking the override.","commonSituations":"ONNX `GatherNd` on weights/activations; attention or lookup-table patterns ported to a minimal backend.","solutions":["Switch to a backend that implements `float_gather_nd`.","Implement `float_gather_nd` in your backend (compute flat indices, then use `float_select`).","Rewrite the gather using supported select/gather primitives with manual index math."],"exampleFix":"// before\nlet out = B::float_gather_nd(data, indices); // panics\n\n// after\nlet flat_idx = compute_flat_indices(indices, data.shape());\nlet out = B::float_select(data.reshape(Shape::from([-1])), flat_idx);","handlingStrategy":"fallback","validationCode":"// Check backend support for gather_nd before graph execution","typeGuard":null,"tryCatchPattern":"let out = std::panic::catch_unwind(|| B::float_gather_nd(d, i))\n    .unwrap_or_else(|_| gather_nd_via_flat_select(d, i));","preventionTips":["Prefer backends with full indexing-op coverage for models using GatherNd.","Implement gather_nd once from select/reshape primitives and reuse across backends.","Exercise GatherNd paths in CI for every backend target."],"tags":["rust","gather","float-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"}