pub struct TensorSelector { /* private fields */ }Expand description
Exact bounded graph-node contract.
Implementations§
Source§impl TensorSelector
impl TensorSelector
Sourcepub fn new(
name: impl Into<String>,
element_type: TensorElementType,
row_elements: usize,
maximum_rows: usize,
access: TensorAccess,
row_mapping: TensorRowMapping,
retain: bool,
) -> Result<Self, TensorTransactionError>
pub fn new( name: impl Into<String>, element_type: TensorElementType, row_elements: usize, maximum_rows: usize, access: TensorAccess, row_mapping: TensorRowMapping, retain: bool, ) -> Result<Self, TensorTransactionError>
Constructs an exact tensor selector.
§Errors
Returns an error for an empty, NUL-containing, or excessive name,
unusable dimensions, an excessive element bound, or mutable non-f32
data.
Sourcepub const fn with_finite_validation(
self,
finite: TensorFiniteValidation,
) -> Self
pub const fn with_finite_validation( self, finite: TensorFiniteValidation, ) -> Self
Sets how aggressively f32 values are validated as finite.
Defaults to TensorFiniteValidation::Strict. Relaxing this trades a
full pass (or two, for ReadWriteF32) over the tensor for the caller’s
guarantee that the values are already finite.
Sourcepub const fn finite_validation(&self) -> TensorFiniteValidation
pub const fn finite_validation(&self) -> TensorFiniteValidation
Returns the finiteness-validation policy.
Sourcepub fn layer_output(
layer: u32,
row_elements: usize,
maximum_rows: usize,
access: TensorAccess,
retain: bool,
) -> Result<Self, TensorTransactionError>
pub fn layer_output( layer: u32, row_elements: usize, maximum_rows: usize, access: TensorAccess, retain: bool, ) -> Result<Self, TensorTransactionError>
Constructs one exact residual layer-output selector.
llama.cpp names these graph nodes l_out-{layer} at the pinned
implementation. The caller remains responsible for binding that naming
profile to its backend revision.
§Errors
Returns an error for unusable dimensions or bounds.
Sourcepub const fn element_type(&self) -> TensorElementType
pub const fn element_type(&self) -> TensorElementType
Returns the required element representation.
Sourcepub const fn row_elements(&self) -> usize
pub const fn row_elements(&self) -> usize
Returns the required elements per row.
Sourcepub const fn maximum_rows(&self) -> usize
pub const fn maximum_rows(&self) -> usize
Returns the inclusive row bound.
Sourcepub const fn access(&self) -> TensorAccess
pub const fn access(&self) -> TensorAccess
Returns native access granted to the handler.
Sourcepub const fn row_mapping(&self) -> TensorRowMapping
pub const fn row_mapping(&self) -> TensorRowMapping
Returns how native rows map to the submitted decode batch.
Sourcepub const fn retains_capture(&self) -> bool
pub const fn retains_capture(&self) -> bool
Returns whether the completed owned tensor is retained after decode.
Trait Implementations§
Source§impl Clone for TensorSelector
impl Clone for TensorSelector
Source§fn clone(&self) -> TensorSelector
fn clone(&self) -> TensorSelector
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more