pub struct JsNSRMachineBuilder { /* private fields */ }Expand description
Builder for creating configured NSRMachine instances
Implementations§
Source§impl JsNSRMachineBuilder
impl JsNSRMachineBuilder
pub fn into_reference( val: JsNSRMachineBuilder, env: Env, ) -> Result<Reference<JsNSRMachineBuilder>>
pub fn into_instance( self, env: Env, ) -> Result<ClassInstance<JsNSRMachineBuilder>>
Source§impl JsNSRMachineBuilder
impl JsNSRMachineBuilder
pub fn new() -> Self
Sourcepub fn embedding_dim(&mut self, dim: u32) -> &Self
pub fn embedding_dim(&mut self, dim: u32) -> &Self
Set the embedding dimension
Set the hidden layer size
Sourcepub fn max_seq_len(&mut self, len: u32) -> &Self
pub fn max_seq_len(&mut self, len: u32) -> &Self
Set the maximum sequence length
Sourcepub fn beam_width(&mut self, width: u32) -> &Self
pub fn beam_width(&mut self, width: u32) -> &Self
Set the beam width for search
Sourcepub fn add_symbol(&mut self, name: String) -> &Self
pub fn add_symbol(&mut self, name: String) -> &Self
Add a symbol to the vocabulary
Sourcepub fn enable_synthesis(&mut self, enable: bool) -> &Self
pub fn enable_synthesis(&mut self, enable: bool) -> &Self
Enable or disable program synthesis
Sourcepub fn with_explainability(&mut self) -> &Self
pub fn with_explainability(&mut self) -> &Self
Enable explainability features
Sourcepub fn build(&mut self) -> Result<JsNSRMachine>
pub fn build(&mut self) -> Result<JsNSRMachine>
Build the NSR machine
Trait Implementations§
Source§impl FromNapiMutRef for JsNSRMachineBuilder
impl FromNapiMutRef for JsNSRMachineBuilder
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for JsNSRMachineBuilder
impl FromNapiRef for JsNSRMachineBuilder
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &JsNSRMachineBuilder
impl FromNapiValue for &JsNSRMachineBuilder
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut JsNSRMachineBuilder
impl FromNapiValue for &mut JsNSRMachineBuilder
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ObjectFinalize for JsNSRMachineBuilder
impl ObjectFinalize for JsNSRMachineBuilder
Source§impl ToNapiValue for JsNSRMachineBuilder
impl ToNapiValue for JsNSRMachineBuilder
Source§unsafe fn to_napi_value(
env: napi_env,
val: JsNSRMachineBuilder,
) -> Result<napi_value>
unsafe fn to_napi_value( env: napi_env, val: JsNSRMachineBuilder, ) -> Result<napi_value>
Safety Read more
Source§impl TypeName for &JsNSRMachineBuilder
impl TypeName for &JsNSRMachineBuilder
Source§impl TypeName for &mut JsNSRMachineBuilder
impl TypeName for &mut JsNSRMachineBuilder
Source§impl TypeName for JsNSRMachineBuilder
impl TypeName for JsNSRMachineBuilder
Source§impl ValidateNapiValue for &JsNSRMachineBuilder
impl ValidateNapiValue for &JsNSRMachineBuilder
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut JsNSRMachineBuilder
impl ValidateNapiValue for &mut JsNSRMachineBuilder
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for JsNSRMachineBuilder
impl !RefUnwindSafe for JsNSRMachineBuilder
impl Send for JsNSRMachineBuilder
impl Sync for JsNSRMachineBuilder
impl Unpin for JsNSRMachineBuilder
impl UnsafeUnpin for JsNSRMachineBuilder
impl !UnwindSafe for JsNSRMachineBuilder
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