oa::ml::nn::FlowTransformer

Reusable bidirectional Transformer backbone for flow/diffusion denoisers.

StRust public API

Declaration

pub struct FlowTransformer { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn forward(&self, tokens: &Matrix) -> Result<Matrix>
pub fn forward_masked( &self, tokens: &Matrix, token_mask: &Matrix, ) -> Result<Matrix>
pub fn forward_conditioned( &self, tokens: &Matrix, condition: &Matrix, token_mask: Option<&Matrix>, ) -> Result<Matrix>
pub fn set_sequence_length(&self, sequence_length: usize) -> Result<()>
pub fn config(&self) -> FlowTransformerConfig
pub fn is_moe(&self) -> bool
pub fn num_layers(&self) -> usize
pub fn block(&self, index: usize) -> Option<&TransformerBlock>
fn forward(&self, input: &Matrix) -> Result<Matrix>
fn registry(&self) -> &ModuleRegistry
fn parameters(&self) -> Vec<Parameter>
fn named_parameters(&self) -> Vec<NamedParameter>
fn buffers(&self) -> Vec<Matrix>
fn named_buffers(&self) -> Vec<NamedBuffer>
fn all_parameters(&self) -> Result<Vec<Parameter>>
fn all_named_parameters(&self) -> Result<Vec<NamedParameter>>
fn all_named_buffers(&self) -> Result<Vec<NamedBuffer>>
fn all_named_state_u32(&self) -> Result<Vec<NamedStateU32>>
fn num_parameters(&self) -> Result<usize>
fn train(&self, training: bool)
fn eval(&self)
fn is_training(&self) -> bool
fn scoped_eval(&self) -> ScopedEval<'_>

Associated Functions

pub fn with_seed( engine: &Engine, config: FlowTransformerConfig, seed: u64, ) -> Result<Self>

Public Method Documentation

pub fn forward( &self, tokens: &Matrix ) -> Result<Matrix>
No public source comment is attached to this declaration.
pub fn forward_masked( &self, tokens: &Matrix, token_mask: &Matrix ) -> Result<Matrix>
No public source comment is attached to this declaration.
pub fn forward_conditioned( &self, tokens: &Matrix, condition: &Matrix, token_mask: Option<&Matrix> ) -> Result<Matrix>
No public source comment is attached to this declaration.
pub fn set_sequence_length(&self, sequence_length: usize) -> Result<()>
No public source comment is attached to this declaration.
pub fn config( &self ) -> FlowTransformerConfig
Construct a deterministic dense or dropless-MoE flow Transformer. Errors Returns an error for invalid geometry, expert routing, epsilon, or failed child construction and registration.
pub fn is_moe( &self ) -> bool
Construct a deterministic dense or dropless-MoE flow Transformer. Errors Returns an error for invalid geometry, expert routing, epsilon, or failed child construction and registration.
pub fn num_layers( &self ) -> usize
Construct a deterministic dense or dropless-MoE flow Transformer. Errors Returns an error for invalid geometry, expert routing, epsilon, or failed child construction and registration.
pub fn block( &self, index: usize ) -> Option<&TransformerBlock>
Construct a deterministic dense or dropless-MoE flow Transformer. Errors Returns an error for invalid geometry, expert routing, epsilon, or failed child construction and registration.
fn forward( &self, input: &Matrix ) -> Result<Matrix>
No public source comment is attached to this declaration.
fn registry( &self ) -> &ModuleRegistry
No public source comment is attached to this declaration.
fn parameters( &self ) -> Vec<Parameter>
No public source comment is attached to this declaration.
fn named_parameters( &self ) -> Vec<NamedParameter>
No public source comment is attached to this declaration.
fn buffers( &self ) -> Vec<Matrix>
No public source comment is attached to this declaration.
fn named_buffers( &self ) -> Vec<NamedBuffer>
No public source comment is attached to this declaration.
fn all_parameters( &self ) -> Result<Vec<Parameter>>
No public source comment is attached to this declaration.
fn all_named_parameters( &self ) -> Result<Vec<NamedParameter>>
No public source comment is attached to this declaration.
fn all_named_buffers( &self ) -> Result<Vec<NamedBuffer>>
No public source comment is attached to this declaration.
fn all_named_state_u32( &self ) -> Result<Vec<NamedStateU32>>
No public source comment is attached to this declaration.
fn num_parameters( &self ) -> Result<usize>
No public source comment is attached to this declaration.
fn train( &self, training: bool )
No public source comment is attached to this declaration.
fn eval( &self )
No public source comment is attached to this declaration.
fn is_training( &self ) -> bool
No public source comment is attached to this declaration.
fn scoped_eval( &self ) -> ScopedEval<'_>
No public source comment is attached to this declaration.
pub fn with_seed( engine: &Engine, config: FlowTransformerConfig, seed: u64 ) -> Result<Self>
No public source comment is attached to this declaration.