{"record":{"id":"c987c4c9ce113de0","repo":"tracel-ai/burn","slug":"burn-device-tch-requested-but-the-tch-feature-i","errorCode":null,"errorMessage":"BURN_DEVICE=tch requested, but the 'tch' feature is not enabled.","messagePattern":"BURN_DEVICE=tch requested, but the 'tch' feature is not enabled\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-dispatch/src/device.rs","lineNumber":266,"sourceCode":"                            feature = \"metal\",\n                            feature = \"vulkan\",\n                            feature = \"webgpu\",\n                            feature = \"wgpu\"\n                        ))]\n                        return Self::Cube(CubeDevice::Wgpu(Default::default()));\n                        panic!(\n                            \"BURN_DEVICE={device_str} requested, but no wgpu feature is enabled.\"\n                        );\n                    }\n                    \"cpu\" => {\n                        #[cfg(feature = \"cpu\")]\n                        return Self::Cube(CubeDevice::Cpu(Default::default()));\n                        panic!(\"BURN_DEVICE=cpu requested, but the 'cpu' feature is not enabled.\");\n                    }\n                    \"tch\" => {\n                        #[cfg(feature = \"tch\")]\n                        return Self::LibTorch(LibTorchDevice::default());\n                        panic!(\"BURN_DEVICE=tch requested, but the 'tch' feature is not enabled.\");\n                    }\n                    \"remote\" => {\n                        #[cfg(feature = \"remote\")]\n                        return Self::Remote(RemoteDevice::default());\n                        panic!(\n                            \"BURN_DEVICE=remote requested, but the 'remote' feature is not enabled.\"\n                        );\n                    }\n                    \"flex\" => {\n                        #[cfg(any(feature = \"flex\", default_backend))]\n                        return Self::Flex(FlexDevice);\n                        panic!(\n                            \"BURN_DEVICE=flex requested, but the 'flex' feature is not enabled.\"\n                        );\n                    }\n                    \"ndarray\" => {\n                        #[cfg(feature = \"ndarray\")]\n                        return Self::NdArray(NdArrayDevice::default());","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-dispatch/src/device.rs#L248-L284","documentation":"BURN_DEVICE selection guard for `tch`: returns the LibTorch backend only when the `tch` feature is compiled; otherwise panics. Fires when the environment requests the tch backend from a build without it.","triggerScenarios":"Thrown at crates/burn-dispatch/src/device.rs:266 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable the `tch` feature (and provide LibTorch) and rebuild.","Pick another enabled backend via BURN_DEVICE.","Unset BURN_DEVICE to use the build's default backend."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}