pub trait TensorIndexing {
// Required methods
fn gather(
&mut self,
operand: &Tensor,
start_indices: &Tensor,
config: &GatherConfig,
) -> Result<Tensor>;
fn scatter(
&mut self,
operand: &Tensor,
scatter_indices: &Tensor,
updates: &Tensor,
config: &ScatterConfig,
) -> Result<Tensor>;
fn slice(&mut self, input: &Tensor, config: &SliceConfig) -> Result<Tensor>;
fn dynamic_slice(
&mut self,
input: &Tensor,
starts: &Tensor,
slice_sizes: &[usize],
) -> Result<Tensor>;
fn dynamic_update_slice(
&mut self,
operand: &Tensor,
update: &Tensor,
starts: &Tensor,
) -> Result<Tensor>;
fn pad(&mut self, input: &Tensor, config: &PadConfig) -> Result<Tensor>;
fn concatenate(&mut self, inputs: &[&Tensor], axis: usize) -> Result<Tensor>;
fn reverse(&mut self, input: &Tensor, axes: &[usize]) -> Result<Tensor>;
}Expand description
Indexing, slicing, and padding operations.
§Examples
use tenferro_tensor::TensorIndexing;
fn accepts_indexing<B: TensorIndexing>(_backend: &mut B) {}Required Methods§
Sourcefn gather(
&mut self,
operand: &Tensor,
start_indices: &Tensor,
config: &GatherConfig,
) -> Result<Tensor>
fn gather( &mut self, operand: &Tensor, start_indices: &Tensor, config: &GatherConfig, ) -> Result<Tensor>
§Errors
Returns crate::Error::Validation with a typed ValidationError source
for invalid shapes, ranks, axes, dtypes, or output metadata. It returns
crate::Error::BackendFailure or crate::Error::BackendSource when
backend execution or storage access cannot provide the requested result.
Sourcefn scatter(
&mut self,
operand: &Tensor,
scatter_indices: &Tensor,
updates: &Tensor,
config: &ScatterConfig,
) -> Result<Tensor>
fn scatter( &mut self, operand: &Tensor, scatter_indices: &Tensor, updates: &Tensor, config: &ScatterConfig, ) -> Result<Tensor>
§Errors
Returns crate::Error::Validation with a typed ValidationError source
for invalid shapes, ranks, axes, dtypes, or output metadata. It returns
crate::Error::BackendFailure or crate::Error::BackendSource when
backend execution or storage access cannot provide the requested result.
Sourcefn slice(&mut self, input: &Tensor, config: &SliceConfig) -> Result<Tensor>
fn slice(&mut self, input: &Tensor, config: &SliceConfig) -> Result<Tensor>
§Errors
Returns crate::Error::Validation with a typed ValidationError source
for invalid shapes, ranks, axes, dtypes, or output metadata. It returns
crate::Error::BackendFailure or crate::Error::BackendSource when
backend execution or storage access cannot provide the requested result.
Sourcefn dynamic_slice(
&mut self,
input: &Tensor,
starts: &Tensor,
slice_sizes: &[usize],
) -> Result<Tensor>
fn dynamic_slice( &mut self, input: &Tensor, starts: &Tensor, slice_sizes: &[usize], ) -> Result<Tensor>
§Errors
Returns crate::Error::Validation with a typed ValidationError source
for invalid shapes, ranks, axes, dtypes, or output metadata. It returns
crate::Error::BackendFailure or crate::Error::BackendSource when
backend execution or storage access cannot provide the requested result.
Sourcefn dynamic_update_slice(
&mut self,
operand: &Tensor,
update: &Tensor,
starts: &Tensor,
) -> Result<Tensor>
fn dynamic_update_slice( &mut self, operand: &Tensor, update: &Tensor, starts: &Tensor, ) -> Result<Tensor>
§Errors
Returns crate::Error::Validation with a typed ValidationError source
for invalid shapes, ranks, axes, dtypes, or output metadata. It returns
crate::Error::BackendFailure or crate::Error::BackendSource when
backend execution or storage access cannot provide the requested result.
Sourcefn pad(&mut self, input: &Tensor, config: &PadConfig) -> Result<Tensor>
fn pad(&mut self, input: &Tensor, config: &PadConfig) -> Result<Tensor>
§Errors
Returns crate::Error::Validation with a typed ValidationError source
for invalid shapes, ranks, axes, dtypes, or output metadata. It returns
crate::Error::BackendFailure or crate::Error::BackendSource when
backend execution or storage access cannot provide the requested result.
Sourcefn concatenate(&mut self, inputs: &[&Tensor], axis: usize) -> Result<Tensor>
fn concatenate(&mut self, inputs: &[&Tensor], axis: usize) -> Result<Tensor>
§Errors
Returns crate::Error::Validation with a typed ValidationError source
for invalid shapes, ranks, axes, dtypes, or output metadata. It returns
crate::Error::BackendFailure or crate::Error::BackendSource when
backend execution or storage access cannot provide the requested result.
Sourcefn reverse(&mut self, input: &Tensor, axes: &[usize]) -> Result<Tensor>
fn reverse(&mut self, input: &Tensor, axes: &[usize]) -> Result<Tensor>
§Errors
Returns crate::Error::Validation with a typed ValidationError source
for invalid shapes, ranks, axes, dtypes, or output metadata. It returns
crate::Error::BackendFailure or crate::Error::BackendSource when
backend execution or storage access cannot provide the requested result.