pub struct InputSignature { /* private fields */ }Expand description
Value-free signature of all tensor inputs for one prepare request.
§Examples
use tenferro_runtime::InputSignature;
let signature = InputSignature::new(Vec::new());
assert!(signature.entries().is_empty());Implementations§
Source§impl InputSignature
impl InputSignature
Sourcepub fn new(entries: Vec<InputSignatureEntry>) -> Self
pub fn new(entries: Vec<InputSignatureEntry>) -> Self
Build a signature from already prepared entries.
§Examples
use tenferro_runtime::InputSignature;
let signature = InputSignature::new(Vec::new());
assert_eq!(signature.entries().len(), 0);Sourcepub fn from_reads(reads: &[TensorRead<'_>]) -> Result<Self, PrepareError>
pub fn from_reads(reads: &[TensorRead<'_>]) -> Result<Self, PrepareError>
Build a value-free signature from borrowed tensor reads.
§Examples
use tenferro_runtime::{InputSignature, TensorRead, Tensor};
let tensor = Tensor::from_vec_col_major(vec![2], vec![1.0_f64, 2.0])?;
let signature = InputSignature::from_reads(&[TensorRead::from_tensor(&tensor)])?;
assert_eq!(signature.entries()[0].shape(), &[2]);§Errors
Returns PrepareError::InputSignature with the original typed tensor
metadata error when shape, stride, or compactness metadata cannot be read.
Sourcepub fn entries(&self) -> &[InputSignatureEntry]
pub fn entries(&self) -> &[InputSignatureEntry]
Return the per-input entries.
§Examples
use tenferro_runtime::InputSignature;
assert!(InputSignature::new(Vec::new()).entries().is_empty());Trait Implementations§
Source§impl Clone for InputSignature
impl Clone for InputSignature
Source§fn clone(&self) -> InputSignature
fn clone(&self) -> InputSignature
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 moreSource§impl Debug for InputSignature
impl Debug for InputSignature
Source§impl Hash for InputSignature
impl Hash for InputSignature
Source§impl PartialEq for InputSignature
impl PartialEq for InputSignature
Source§fn eq(&self, other: &InputSignature) -> bool
fn eq(&self, other: &InputSignature) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for InputSignature
impl StructuralPartialEq for InputSignature
Auto Trait Implementations§
impl Freeze for InputSignature
impl RefUnwindSafe for InputSignature
impl Send for InputSignature
impl Sync for InputSignature
impl Unpin for InputSignature
impl UnsafeUnpin for InputSignature
impl UnwindSafe for InputSignature
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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