pub struct LunaEncoder {
pub model_cfg: ModelConfig,
pub device: Device,
/* private fields */
}Expand description
RLX LUNA encoder with per-shape compiled-graph cache.
Fields§
§model_cfg: ModelConfig§device: DeviceImplementations§
Source§impl LunaEncoder
impl LunaEncoder
pub fn load( config_path: &Path, weights_path: &Path, device: Device, ) -> Result<(Self, f64)>
pub fn describe(&self) -> String
Sourcepub fn run_epoch(
&mut self,
signal: &[f32],
chan_pos: &[f32],
channel_indices: Option<&[i32]>,
n_channels: usize,
n_samples: usize,
) -> Result<EpochEmbedding>
pub fn run_epoch( &mut self, signal: &[f32], chan_pos: &[f32], channel_indices: Option<&[i32]>, n_channels: usize, n_samples: usize, ) -> Result<EpochEmbedding>
Run inference on one epoch.
Sourcepub fn run_epoch_opts(
&mut self,
signal: &[f32],
chan_pos: &[f32],
channel_indices: Option<&[i32]>,
n_channels: usize,
n_samples: usize,
opts: RunEpochOpts,
) -> Result<EpochEmbedding>
pub fn run_epoch_opts( &mut self, signal: &[f32], chan_pos: &[f32], channel_indices: Option<&[i32]>, n_channels: usize, n_samples: usize, opts: RunEpochOpts, ) -> Result<EpochEmbedding>
Run inference with explicit options (e.g. skip normalisation for parity vectors).
Sourcepub fn run_forward_prepared(
&mut self,
x_tokenized: &[f32],
decoder_queries: &[f32],
b: usize,
c: usize,
t: usize,
chan_pos: &[f32],
) -> Result<EpochEmbedding>
pub fn run_forward_prepared( &mut self, x_tokenized: &[f32], decoder_queries: &[f32], b: usize, c: usize, t: usize, chan_pos: &[f32], ) -> Result<EpochEmbedding>
Run the RLX graph from prepared x_tokenized / decoder_queries (skips CPU prepare).
Sourcepub fn run_rlx_epoch(&mut self, ep: &RlxEpoch) -> Result<EpochEmbedding>
pub fn run_rlx_epoch(&mut self, ep: &RlxEpoch) -> Result<EpochEmbedding>
Convenience wrapper around super::io::RlxEpoch.
Auto Trait Implementations§
impl Freeze for LunaEncoder
impl !RefUnwindSafe for LunaEncoder
impl Send for LunaEncoder
impl !Sync for LunaEncoder
impl Unpin for LunaEncoder
impl UnsafeUnpin for LunaEncoder
impl !UnwindSafe for LunaEncoder
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> 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