pub trait SessionCachedDot: TensorDot {
// Provided method
fn dot_general_read_into_accum_cached(
&mut self,
_cache_slot: Option<usize>,
lhs: TensorRead<'_>,
rhs: TensorRead<'_>,
config: &DotGeneralConfig,
accumulation: DotGeneralAccumulation,
out: TensorWrite<'_>,
) -> Result<()> { ... }
}Expand description
Session-scoped cached dot-general operations.
§Examples
use tenferro_tensor::BackendSession;
fn accepts_session_dot<S: BackendSession + ?Sized>(_session: &mut S) {}Provided Methods§
Sourcefn dot_general_read_into_accum_cached(
&mut self,
_cache_slot: Option<usize>,
lhs: TensorRead<'_>,
rhs: TensorRead<'_>,
config: &DotGeneralConfig,
accumulation: DotGeneralAccumulation,
out: TensorWrite<'_>,
) -> Result<()>
fn dot_general_read_into_accum_cached( &mut self, _cache_slot: Option<usize>, lhs: TensorRead<'_>, rhs: TensorRead<'_>, config: &DotGeneralConfig, accumulation: DotGeneralAccumulation, out: TensorWrite<'_>, ) -> Result<()>
Apply session-cached scaled dot-general accumulation into output.
The cache slot is session-local metadata; accumulation still controls
overwrite versus read-modify-write semantics.
§Examples
use tenferro_tensor::{
DotGeneralAccumulation, DotGeneralConfig, SessionCachedDot, TensorRead, TensorWrite,
};
fn session_cached_dot_add_to<S: SessionCachedDot + ?Sized>(
session: &mut S,
lhs: TensorRead<'_>,
rhs: TensorRead<'_>,
config: &DotGeneralConfig,
out: TensorWrite<'_>,
) -> tenferro_tensor::Result<()> {
let accumulation = DotGeneralAccumulation::add_to(lhs.dtype())?;
session.dot_general_read_into_accum_cached(
Some(0),
lhs,
rhs,
config,
accumulation,
out,
)
}