pub trait Operators {
type Elem;
// Required methods
fn arg_max(
&self,
axis: isize,
keep_dims: bool,
) -> Result<Tensor<i32>, OpError>
where Self::Elem: Copy + PartialOrd + IsNaN;
fn div(
&self,
other: TensorView<'_, Self::Elem>,
) -> Result<Tensor<Self::Elem>, OpError>
where Self::Elem: Copy + Debug + Default + PartialEq + Mul<Output = Self::Elem> + Div<Output = Self::Elem> + IsInt + Identities;
fn mul(
&self,
other: TensorView<'_, Self::Elem>,
) -> Result<Tensor<Self::Elem>, OpError>
where Self::Elem: Copy + Debug + Default + Mul<Output = Self::Elem>;
fn reduce_max(
&self,
axes: Option<&[i32]>,
keep_dims: bool,
) -> Result<Tensor<Self::Elem>, OpError>
where Self::Elem: Copy + PartialOrd + IsNaN + MinMax;
fn reduce_min(
&self,
axes: Option<&[i32]>,
keep_dims: bool,
) -> Result<Tensor<Self::Elem>, OpError>
where Self::Elem: Copy + PartialOrd + IsNaN + MinMax;
fn reduce_sum(
&self,
axes: Option<&[i32]>,
keep_dims: bool,
) -> Result<Tensor<Self::Elem>, OpError>
where Self::Elem: Copy + Default + Add<Self::Elem, Output = Self::Elem>;
fn pad(
&self,
padding: NdTensorView<'_, i32, 1>,
val: Self::Elem,
) -> Result<Tensor<Self::Elem>, OpError>
where Self::Elem: Copy + Default + PartialEq;
fn topk(
&self,
k: usize,
axis: Option<isize>,
largest: bool,
sorted: bool,
) -> Result<(Tensor<Self::Elem>, Tensor<i32>), OpError>
where Self::Elem: Copy + Default + PartialOrd + IsNaN;
}Expand description
Trait which exposes ONNX operators as methods of tensors.
This trait provides methods which are available on all tensor types. See
FloatOperators for additional operators which are only available on float
tensors.
Required Associated Types§
Required Methods§
fn arg_max(&self, axis: isize, keep_dims: bool) -> Result<Tensor<i32>, OpError>
fn div( &self, other: TensorView<'_, Self::Elem>, ) -> Result<Tensor<Self::Elem>, OpError>
fn mul( &self, other: TensorView<'_, Self::Elem>, ) -> Result<Tensor<Self::Elem>, OpError>
fn reduce_max( &self, axes: Option<&[i32]>, keep_dims: bool, ) -> Result<Tensor<Self::Elem>, OpError>
fn reduce_min( &self, axes: Option<&[i32]>, keep_dims: bool, ) -> Result<Tensor<Self::Elem>, OpError>
fn reduce_sum( &self, axes: Option<&[i32]>, keep_dims: bool, ) -> Result<Tensor<Self::Elem>, OpError>
fn pad( &self, padding: NdTensorView<'_, i32, 1>, val: Self::Elem, ) -> Result<Tensor<Self::Elem>, OpError>
fn topk( &self, k: usize, axis: Option<isize>, largest: bool, sorted: bool, ) -> Result<(Tensor<Self::Elem>, Tensor<i32>), OpError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".