pub trait ReluPointwise<F>: NN<F> {
    // Required methods
    fn relu_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>;
    fn relu_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 relu_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>

Computes the [Rectified linear units][relu] over the input Tensor x. [relu]: https://en.wikipedia.org/wiki/Rectifier_(neural_networks)

Saves the result back to x.

source

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

Computes the gradient of [ReLU][relu] over the input Tensor x. [relu]: https://en.wikipedia.org/wiki/Rectifier_(neural_networks)

Saves the result back to x_diff.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ReluPointwise<f32> for Backend<Native>

source§

impl ReluPointwise<f64> for Backend<Native>

source§

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

source§

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

source§

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

Implementors§