pub trait Backend {
Show 53 methods
// Required methods
fn name(&self) -> &'static str;
fn has_cublas(&self) -> bool;
unsafe fn alloc(&self, n: usize) -> Result<BackendArray>;
fn alloc_and_store_zeros(&self, n: usize) -> Result<BackendArray>;
fn alloc_and_store(&self, elems: &[f32]) -> Result<BackendArray>;
fn load(&self, a: &BackendArray, elems: &mut [f32]) -> Result<()>;
fn store(&self, a: &BackendArray, elems: &[f32]) -> Result<()>;
fn copy(&self, a: &BackendArray, b: &BackendArray) -> Result<()>;
fn transpose_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn add_a_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn add_at_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn add_a_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn add_at_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sub_a_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sub_at_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sub_a_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sub_at_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn mul_a_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
l: usize,
) -> Result<()>;
fn mul_at_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
l: usize,
) -> Result<()>;
fn mul_a_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
l: usize,
) -> Result<()>;
fn mul_at_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
l: usize,
) -> Result<()>;
fn mul_a_b_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn mul_at_b_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn mul_a_bt_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn mul_at_bt_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn div_a_b_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn div_at_b_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn div_a_bt_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn div_at_bt_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn add_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn add_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sub_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sub_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn rsub_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn rsub_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn mul_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn mul_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn div_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn div_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn rdiv_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn rdiv_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sigmoid_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sigmoid_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn tanh_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn tanh_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn swish_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn swish_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn softmax_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn softmax_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sqrt_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn sqrt_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn repeat_col_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
fn repeat_row_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>;
}
Expand description
A backend trait.
The backend provides a low-level interface to computing platform (OpenCL or CUDA) for basic operations and functions on matrices. The backend methods operate on backend arrays which refers to areas of the device memory. The backend is low-level layer between a frontend and computing platform.
Required Methods§
Sourcefn has_cublas(&self) -> bool
fn has_cublas(&self) -> bool
Returns true
if the backend uses cuBLAS, otherwise false
.
Sourceunsafe fn alloc(&self, n: usize) -> Result<BackendArray>
unsafe fn alloc(&self, n: usize) -> Result<BackendArray>
Allocates a backend array.
Sourcefn alloc_and_store_zeros(&self, n: usize) -> Result<BackendArray>
fn alloc_and_store_zeros(&self, n: usize) -> Result<BackendArray>
Allocates a backend array and stores zeros in the backend array.
Sourcefn alloc_and_store(&self, elems: &[f32]) -> Result<BackendArray>
fn alloc_and_store(&self, elems: &[f32]) -> Result<BackendArray>
Allocates a backend array and stores the elements in the backend array.
Sourcefn load(&self, a: &BackendArray, elems: &mut [f32]) -> Result<()>
fn load(&self, a: &BackendArray, elems: &mut [f32]) -> Result<()>
Loads elements from the backenc array.
Sourcefn store(&self, a: &BackendArray, elems: &[f32]) -> Result<()>
fn store(&self, a: &BackendArray, elems: &[f32]) -> Result<()>
Stores elements in the backend array.
Sourcefn copy(&self, a: &BackendArray, b: &BackendArray) -> Result<()>
fn copy(&self, a: &BackendArray, b: &BackendArray) -> Result<()>
Copies the a
backend array to the b
backend array.
Sourcefn transpose_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn transpose_a( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Transposes the a
matrix and then the result is in the b
matrix
().
Sourcefn add_a_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn add_a_b( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Adds the b
matrix to the a
matrix and then the result is in the c
matrix
().
Sourcefn add_at_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn add_at_b( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Adds the b
matrix to the transposed a
matrix and then the result is in the c
matrix
().
Sourcefn add_a_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn add_a_bt( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Adds the transposed b
matrix to the a
matrix and then the result is in the c
matrix
().
Sourcefn add_at_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn add_at_bt( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Adds the transposed b
matrix to the transposed a
matrix and then the result is in the
c
matrix
().
Sourcefn sub_a_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sub_a_b( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Subtracts the b
matrix from the a
matrix and then the result is in the c
matrix
().
Sourcefn sub_at_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sub_at_b( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Subtracts the b
matrix from the transposed a
matrix and then the result is in the c
matrix
().
Sourcefn sub_a_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sub_a_bt( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Subtracts the transposed b
matrix from the a
matrix and then the result is in the c
matrix
().
Sourcefn sub_at_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sub_at_bt( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Subtracts the transposed b
matrix from the transposed a
matrix and then the result is
in the c
matrix
().
Sourcefn mul_a_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
l: usize,
) -> Result<()>
fn mul_a_b( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, l: usize, ) -> Result<()>
Multiplies the a
matrix by the b
matrix and then the result is in the c
matrix
().
Sourcefn mul_at_b(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
l: usize,
) -> Result<()>
fn mul_at_b( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, l: usize, ) -> Result<()>
Multiplies the transposed a
matrix by the b
matrix and then the result is in the c
matrix
().
Sourcefn mul_a_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
l: usize,
) -> Result<()>
fn mul_a_bt( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, l: usize, ) -> Result<()>
Multiplies the a
matrix by the transposed b
matrix and then the result is in the c
matrix
().
Sourcefn mul_at_bt(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
l: usize,
) -> Result<()>
fn mul_at_bt( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, l: usize, ) -> Result<()>
Multiplies the transposed a
matrix by the transposed b
matrix and then the result is in
the c
matrix
().
Sourcefn mul_a_b_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn mul_a_b_for_elems( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Multiplies the a
matrix elements by the b
matrix elements and then the result is in the
c
matrix
().
Sourcefn mul_at_b_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn mul_at_b_for_elems( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Multiplies the transposed a
matrix elements by the b
matrix elements and saves the
result to the c
matrix
().
Sourcefn mul_a_bt_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn mul_a_bt_for_elems( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Multiplies the a
matrix elements by the transposed b
matrix elements and then the
result is in the c
matrix
().
Sourcefn mul_at_bt_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn mul_at_bt_for_elems( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Multiplies the transposed a
matrix elements by the transposed b
matrix elements and
then the result is in the c
matrix.
().
Sourcefn div_a_b_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn div_a_b_for_elems( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Divides the a
matrix elements by the b
matrix elements and then the result is in the
c
matrix
().
Sourcefn div_at_b_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn div_at_b_for_elems( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Divides the transposed a
matrix elements by the b
matrix elements and then the result
is in the c
matrix
().
Sourcefn div_a_bt_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn div_a_bt_for_elems( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Divides the transposed a
matrix elements by the b
matrix elements and then the result
is in the c
matrix
().
Sourcefn div_at_bt_for_elems(
&self,
a: &BackendArray,
b: &BackendArray,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn div_at_bt_for_elems( &self, a: &BackendArray, b: &BackendArray, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Divides the transposed a
matrix elements by the transposed b
matrix elements and then
the result is in the c
matrix
().
Sourcefn add_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn add_a_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Adds the b
scalar to the a
matrix and then the result is in the c
matrix
().
Sourcefn add_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn add_at_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Adds the b
scalar to the transposed a
matrix and then the result is in the c
matrix
().
Sourcefn sub_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sub_a_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Subtracts the b
scalar from the a
matrix and then the result is in the c
matrix.
().
Sourcefn sub_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sub_at_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Subtracts the b
scalar from the transposed a
matrix and then the result is in the c
matrix
().
Sourcefn rsub_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn rsub_a_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Subtracts the a
matrix from the b
scalar and then the result is in the c
matrix
().
Sourcefn rsub_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn rsub_at_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Subtracts the transposed a
matrix from the b
scalar and then the result is in the c
matrix
().
Sourcefn mul_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn mul_a_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Multiplies the a
matrix by the b
scalar and then the result is in the c
matrix
().
Sourcefn mul_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn mul_at_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Multiplies the transposed a
matrix by the b
scalar and then the result is in the c
matrix
().
Sourcefn div_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn div_a_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Divides the a
matrix by the b
scalar and then the result is in the c
matrix
().
Sourcefn div_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn div_at_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Divides the transposed a
matrix by the b
scalar and then the result is in the c
matrix
().
Sourcefn rdiv_a_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn rdiv_a_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Divides the b
scalar by the a
matrix elements and then the result is in the c
matrix
().
Sourcefn rdiv_at_b_for_scalar(
&self,
a: &BackendArray,
b: f32,
c: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn rdiv_at_b_for_scalar( &self, a: &BackendArray, b: f32, c: &BackendArray, n: usize, m: usize, ) -> Result<()>
Divides the b
scalar by the transposed a
matrix elements and then the result is in the
c
matrix
().
Sourcefn sigmoid_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sigmoid_a( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates sigmoid function for the a
matrix adn the result is the b
matrix
().
Sourcefn sigmoid_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sigmoid_at( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates sigmoid function for the transposed a
matrix and then the result is in the b
matrix
().
Sourcefn tanh_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn tanh_a( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates hyperbolic tangent function for the a
matrix and then the result is in b
matrix
().
Sourcefn tanh_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn tanh_at( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates hyperbolic tangent function for the transposed a
matrix and then the result is
in the b
matrix
().
Sourcefn swish_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn swish_a( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates swish function for the a
matrix adn the result is the b
matrix
().
Sourcefn swish_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn swish_at( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates swish function for the transposed a
matrix and then the result is in the b
matrix
().
Sourcefn softmax_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn softmax_a( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates softmax function for the a
matrix and then the result is in the b
matrix
().
Sourcefn softmax_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn softmax_at( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates softmax function for the transposed a
matrix and then the result is in the b
matrix
().
Sourcefn sqrt_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sqrt_a( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates square root of the a
matrix adn the result is the b
matrix
().
Sourcefn sqrt_at(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn sqrt_at( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Calculates square root of the transposed a
matrix and then the result is in the b
matrix
().
Sourcefn repeat_col_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn repeat_col_a( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Repeats the a
vector as column
().
Sourcefn repeat_row_a(
&self,
a: &BackendArray,
b: &BackendArray,
n: usize,
m: usize,
) -> Result<()>
fn repeat_row_a( &self, a: &BackendArray, b: &BackendArray, n: usize, m: usize, ) -> Result<()>
Repeats the a
vector as row
().