pub trait TanhPointwise<F>: NN<F> {
    // Required methods
    fn tanh_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>;
    fn tanh_pointwise_grad(
        &self,
        x: &SharedTensor<F>,
        x_diff: &mut SharedTensor<F>
    ) -> Result<(), Error>;
}
Expand description

Provides the functionality for pointwise ReLU operations (overwrites the input with the result of the operation).

Required Methods§

source

fn tanh_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>

Computes the [hyperbolic Tangent][tanh] over the input Tensor x. [tanh]: https://en.wikipedia.org/wiki/Hyperbolic_function

Saves the result back to x.

source

fn tanh_pointwise_grad( &self, x: &SharedTensor<F>, x_diff: &mut SharedTensor<F> ) -> Result<(), Error>

Computes the gradient of [tanh][tanh] over the input Tensor x. [tanh]: https://en.wikipedia.org/wiki/Hyperbolic_function

Saves the result back to x_diff.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TanhPointwise<f32> for Backend<Native>

source§

impl TanhPointwise<f64> for Backend<Native>

source§

impl<T> TanhPointwise<T> for Backend<Cuda>
where T: Float + Default + DataTypeInfo,

source§

fn tanh_pointwise(&self, x: &mut SharedTensor<T>) -> Result<(), Error>

source§

fn tanh_pointwise_grad( &self, x: &SharedTensor<T>, x_diff: &mut SharedTensor<T> ) -> Result<(), Error>

Implementors§