Skip to main content

TensorAnalytic

Trait TensorAnalytic 

Source
pub trait TensorAnalytic {
    // Required methods
    fn exp_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
    fn log_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
    fn sin_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
    fn cos_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
    fn tanh_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
    fn sqrt_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
    fn rsqrt_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
    fn pow_read(
        &mut self,
        lhs: TensorRead<'_>,
        rhs: TensorRead<'_>,
    ) -> Result<Tensor>;
    fn expm1_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
    fn log1p_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
    fn erf_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>;
}
Expand description

Analytic unary and binary tensor operations.

§Examples

use tenferro_tensor::TensorAnalytic;

fn accepts_analytic<B: TensorAnalytic>(_backend: &mut B) {}

Required Methods§

Source

fn exp_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn exp_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.exp_read(input)
}
§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.

Source

fn log_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn log_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.log_read(input)
}
§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.

Source

fn sin_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn sin_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.sin_read(input)
}
§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.

Source

fn cos_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn cos_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.cos_read(input)
}
§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.

Source

fn tanh_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn tanh_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.tanh_read(input)
}
§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.

Source

fn sqrt_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn sqrt_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.sqrt_read(input)
}
§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.

Source

fn rsqrt_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn rsqrt_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.rsqrt_read(input)
}
§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.

Source

fn pow_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, ) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn pow_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    lhs: TensorRead<'_>,
    rhs: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.pow_read(lhs, rhs)
}
§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.

Source

fn expm1_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn expm1_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.expm1_read(input)
}
§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.

Source

fn log1p_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn log1p_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.log1p_read(input)
}
§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.

Source

fn erf_read(&mut self, input: TensorRead<'_>) -> Result<Tensor>

Elementwise error function erf(x) = 2/sqrt(pi) * integral_0^x exp(-t^2) dt.

Defined for real F32 and F64 input only; the result has the input dtype and shape. erf(+-0) = +-0, erf(+-inf) = +-1, and NaN stays NaN.

§Examples
use tenferro_tensor::{TensorAnalytic, Tensor, TensorRead};

fn erf_read_in_session<B: TensorAnalytic>(
    backend: &mut B,
    input: TensorRead<'_>,
) -> tenferro_tensor::Result<Tensor> {
    backend.erf_read(input)
}
§Errors

Returns crate::Error::UnsupportedDType for a complex, integer, or Bool input dtype, crate::Error::Validation with a typed ValidationError source for invalid shapes or output metadata, and crate::Error::BackendFailure or crate::Error::BackendSource when backend execution or storage access cannot provide the requested result.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§