pub struct NeuronPredictor { /* private fields */ }Expand description
A float32 Neuron predictor. Inputs, leaves, and ordered tree sums are float32; numerical thresholds round down. Device failures never select a CPU fallback.
Implementations§
Source§impl NeuronPredictor
impl NeuronPredictor
Sourcepub fn new(model: &Model, ordinal: Option<usize>) -> Result<Self>
pub fn new(model: &Model, ordinal: Option<usize>) -> Result<Self>
Validates and uploads a forest once and binds reusable, bounded row tiles.
pub fn num_trees(&self) -> usize
pub fn num_features(&self) -> usize
Sourcepub fn predict_raw(
&mut self,
rows: &DenseMatrix<'_>,
num_trees: Option<usize>,
out: &mut [f32],
) -> Result<()>
pub fn predict_raw( &mut self, rows: &DenseMatrix<'_>, num_trees: Option<usize>, out: &mut [f32], ) -> Result<()>
Writes one raw float32 score per row using a clamped tree prefix. Accepts f32/f64 input in either layout; f64 is quantized before decisions. Invalid dimensions, storage, or output lengths fail before any output write.
Auto Trait Implementations§
impl !Sync for NeuronPredictor
impl Forget for NeuronPredictor
impl Freeze for NeuronPredictor
impl Move for NeuronPredictor
impl RefUnwindSafe for NeuronPredictor
impl Send for NeuronPredictor
impl Unpin for NeuronPredictor
impl UnsafeUnpin for NeuronPredictor
impl UnwindSafe for NeuronPredictor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more