1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Pure-Rust native-tensor backend (`candle`).
//!
//! Unlike `ort` and `tract`, this backend does not interpret the ONNX graph. `candle-onnx`
//! cannot execute either of sceptre's models — it rejects the recognizer's bidirectional
//! LSTMs, CRAFT's padded `MaxPool`, and CRAFT's bilinear `Resize` — so the two networks are
//! written out by hand against `candle_nn` and the trained weights are read from the same
//! ONNX files the other backends load. No separate weight artifact exists.
//!
//! Per the `backend-seam` decision, `candle` APIs are referenced only from this module.
pub use CandleBackend;
use crateAccelerator;
use crateOcrError;
/// The accelerator this build would actually run on, or `None` when none can be opened.
///
/// Opening a device is a side effect, so this resolves one and drops it rather than
/// guessing — the same contract as the `ort` probe, and for the same reason: published
/// provenance must name what ran, not what was asked for.
pub
/// Build an [`OcrError::Inference`] wrapping a candle error with operation context.
pub