pub struct OnnxEntityEmbedder { /* private fields */ }Expand description
Runs entity features through an already-open model session to produce an
Embedding.
The embedder never loads a model, chooses a backend, or moves data across a device boundary: the caller supplies an open session, names the input and output tensors, and selects the copy policy. This keeps backend identity and transfer semantics explicit and auditable.
Implementations§
Source§impl OnnxEntityEmbedder
impl OnnxEntityEmbedder
Sourcepub fn try_new(
input_name: impl Into<String>,
output_name: impl Into<String>,
input_descriptor: TensorDescriptor,
output_descriptor: TensorDescriptor,
copy_policy: CopyPolicy,
) -> SemanticResult<Self>
pub fn try_new( input_name: impl Into<String>, output_name: impl Into<String>, input_descriptor: TensorDescriptor, output_descriptor: TensorDescriptor, copy_policy: CopyPolicy, ) -> SemanticResult<Self>
Creates an embedder for one model input/output pair.
Sourcepub fn embed_one(
&self,
session: &mut dyn ModelSession,
features: &[f32],
) -> SemanticResult<Embedding>
pub fn embed_one( &self, session: &mut dyn ModelSession, features: &[f32], ) -> SemanticResult<Embedding>
Embeds one feature vector (flattened f32 values) into an embedding.
features must contain exactly the element count implied by
input_descriptor. The session’s output_name tensor must match
output_descriptor.
Sourcepub fn input_descriptor(&self) -> &TensorDescriptor
pub fn input_descriptor(&self) -> &TensorDescriptor
Returns the configured input descriptor.
Sourcepub fn output_descriptor(&self) -> &TensorDescriptor
pub fn output_descriptor(&self) -> &TensorDescriptor
Returns the configured output descriptor.
Trait Implementations§
Source§impl Clone for OnnxEntityEmbedder
impl Clone for OnnxEntityEmbedder
Source§fn clone(&self) -> OnnxEntityEmbedder
fn clone(&self) -> OnnxEntityEmbedder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OnnxEntityEmbedder
impl RefUnwindSafe for OnnxEntityEmbedder
impl Send for OnnxEntityEmbedder
impl Sync for OnnxEntityEmbedder
impl Unpin for OnnxEntityEmbedder
impl UnsafeUnpin for OnnxEntityEmbedder
impl UnwindSafe for OnnxEntityEmbedder
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