Struct menoh::ModelBuilder [−][src]
pub struct ModelBuilder<'a, 's> { /* fields omitted */ }
Builder of model.
Mainly used for buffer control.
Methods
impl<'a, 's> ModelBuilder<'a, 's>
[src]
impl<'a, 's> ModelBuilder<'a, 's>
pub fn new(vpt: &VariableProfileTable) -> Result<Self, Error>
[src]
pub fn new(vpt: &VariableProfileTable) -> Result<Self, Error>
pub fn attach_external_buffer<T>(
&mut self,
name: &'s str,
buffer: &Buffer<'a, T>,
vpt: &VariableProfileTable
) -> Result<(), Error> where
T: DtypeCompatible,
[src]
pub fn attach_external_buffer<T>(
&mut self,
name: &'s str,
buffer: &Buffer<'a, T>,
vpt: &VariableProfileTable
) -> Result<(), Error> where
T: DtypeCompatible,
Attach external buffer to the Model
generated from this instance.
If user doesn't attach external buffer, then internal buffer is automatically generaged
inside Model
.
Model
lifetime is bounded by buffer internal data.
If user can ensure buffer dtype and size is valid, and VariableProfileTable
is out of
scope, there is an unsafe version of this method,
attach_external_buffer_unchecked
, which doesn't
require VariableProfileTable
and skip validation against passed buffer.
pub unsafe fn attach_external_buffer_unchecked<T>(
&mut self,
name: &'s str,
buffer: &Buffer<'a, T>
) -> Result<(), Error> where
T: DtypeCompatible,
[src]
pub unsafe fn attach_external_buffer_unchecked<T>(
&mut self,
name: &'s str,
buffer: &Buffer<'a, T>
) -> Result<(), Error> where
T: DtypeCompatible,
Attach external buffer to the Model
generated from this instance.
If user doesn't attach external buffer, then internal buffer is automatically generaged inside model.
Model
lifetime is bounded by buffer internal data.
See the safe version, attach_external_buffer
, for more
infomation.
Safety
This function is unsafe because it does not check that passed buffer is valid dtype and have enough size.
User must ensure Dtype
and size of internal buffer size on oneself.
pub fn build_model(
&self,
model_data: &ModelData,
backend_name: Backend,
backend_config: &str
) -> Result<Model<'a, 's>, Error>
[src]
pub fn build_model(
&self,
model_data: &ModelData,
backend_name: Backend,
backend_config: &str
) -> Result<Model<'a, 's>, Error>
Build model.
After calling build_model
, User can drop the instance of ModelBuilder
in arbitary timing.
Trait Implementations
impl<'a, 's> Drop for ModelBuilder<'a, 's>
[src]
impl<'a, 's> Drop for ModelBuilder<'a, 's>
Auto Trait Implementations
impl<'a, 's> !Send for ModelBuilder<'a, 's>
impl<'a, 's> !Send for ModelBuilder<'a, 's>
impl<'a, 's> !Sync for ModelBuilder<'a, 's>
impl<'a, 's> !Sync for ModelBuilder<'a, 's>