{"record":{"id":"93aa682cedae81d8","repo":"tracel-ai/burn","slug":"bicubic-interpolation-backward-is-not-supported-fo","errorCode":null,"errorMessage":"bicubic interpolation backward is not supported for ndarray backend","messagePattern":"bicubic interpolation backward is not supported for ndarray backend","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-ndarray/src/ops/module.rs","lineNumber":359,"sourceCode":"\n    fn interpolate_backward(\n        x: FloatTensor<Self>,\n        grad: FloatTensor<Self>,\n        output_size: [usize; 2],\n        options: InterpolateOptions,\n    ) -> FloatTensor<Self> {\n        match options.mode {\n            InterpolateMode::Nearest => module_op!(inp(x, grad), opt(), E, |x, grad| {\n                nearest_interpolate_backward::<E>(x, grad, output_size).into()\n            }),\n            InterpolateMode::NearestExact => {\n                panic!(\"nearest exact interpolation backward is not supported for ndarray backend\")\n            }\n            InterpolateMode::Bilinear => {\n                panic!(\"bilinear interpolation backward is not supported for ndarray backend\")\n            }\n            InterpolateMode::Bicubic => {\n                panic!(\"bicubic interpolation backward is not supported for ndarray backend\")\n            }\n            InterpolateMode::Lanczos3 => {\n                panic!(\"lanczos3 interpolation backward is not supported for ndarray backend\")\n            }\n        }\n    }\n\n    fn conv3d(\n        x: FloatTensor<Self>,\n        weight: FloatTensor<Self>,\n        bias: Option<FloatTensor<Self>>,\n        options: ConvOptions<3>,\n    ) -> FloatTensor<Self> {\n        module_op!(inp(x, weight), opt(bias), E, |x, weight, bias| conv3d::<E>(\n            x, weight, bias, options\n        )\n        .into())\n    }","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-ndarray/src/ops/module.rs#L341-L377","documentation":"interpolate_backward in the ndarray backend has no backward implementation for InterpolateMode::Bicubic and panics. Bicubic resizing gradients are simply not implemented for this CPU backend. Only Nearest mode backward is supported.","triggerScenarios":"Backpropagating through an interpolate node with InterpolateMode::Bicubic while using burn-ndarray as the backend.","commonSituations":"Training image super-resolution or generative models that use bicubic upsampling layers on the ndarray CPU backend.","solutions":["Use InterpolateMode::Nearest, which has a backward pass on ndarray","Switch backends (burn-cube/cubecl or burn-torch) which support bicubic backward","Keep bicubic only in inference paths outside the autodiff graph"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if mode == InterpolateMode::Bicubic && backend_is_ndarray() { /* reconfigure */ }","typeGuard":"fn supports_backward(mode: &InterpolateMode) -> bool {\n    matches!(mode, InterpolateMode::Nearest)\n}","tryCatchPattern":null,"preventionTips":["Keep bicubic resampling in inference-only preprocessing","Prefer Nearest for trainable upsample layers on ndarray"],"tags":["rust","burn-ndarray","autodiff","unsupported-op"],"backgroundTag":"unsupported-op-backend","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"}