Skip to main content

Posterior

Trait Posterior 

Source
trait Posterior:
    Copy
    + Default
    + Send
    + Sync
    + 'static {
    // Required methods
    fn get(self) -> f32;
    fn put(v: f32) -> Self;
    fn store(v: Vec<f32>) -> Vec<Self>;

    // Provided methods
    fn load(src: &[Self], dst: &mut [f32]) { ... }
    fn save(src: &[f32], dst: &mut [Self]) { ... }
}
Expand description

A stored posterior value: f32, or half::f16 for PosteriorPrecision::F16. Arithmetic is in f32 either way.

Required Methods§

Source

fn get(self) -> f32

Source

fn put(v: f32) -> Self

Source

fn store(v: Vec<f32>) -> Vec<Self>

Convert a single-precision buffer (no copy when Self is f32).

Provided Methods§

Source

fn load(src: &[Self], dst: &mut [f32])

dst[i] = src[i].get(), in bulk.

Source

fn save(src: &[f32], dst: &mut [Self])

dst[i] = put(src[i]), in bulk.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Posterior for f16

Available on crate feature onnx only.
Source§

fn get(self) -> f32

Source§

fn put(v: f32) -> Self

Source§

fn store(v: Vec<f32>) -> Vec<Self>

Source§

fn load(src: &[Self], dst: &mut [f32])

Source§

fn save(src: &[f32], dst: &mut [Self])

Source§

impl Posterior for f32

Source§

fn get(self) -> f32

Source§

fn put(v: f32) -> Self

Source§

fn store(v: Vec<f32>) -> Vec<Self>

Source§

fn load(src: &[Self], dst: &mut [f32])

Source§

fn save(src: &[f32], dst: &mut [Self])

Implementors§