nnlib
GPU-accelerated, C/C++ neural network library.
Classes | Typedefs | Functions
tensor.h File Reference

Header file declaring the Tensor class to represent multidimensional arrays. More...

#include "allocation.h"
#include "cache.h"
#include "session.cuh"
#include <cstdlib>
#include <iostream>
#include <memory>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  Tensor
 Class to represent multidimensional arrays. More...
 

Typedefs

typedef std::shared_ptr< TensorsTensor
 

Functions

std::ostream & operator<< (std::ostream &stream, const Tensor &tensor)
 Enables the tensor to be printed using std::cout. More...
 
sTensor sum (const sTensor &a)
 
void fill (float value, sTensor &tensor)
 
void fill (const sTensor &value, sTensor &tensor)
 
sTensor add (const sTensor &a, const sTensor &b)
 
sTensor subtract (const sTensor &a, const sTensor &b)
 
sTensor hadamard (const sTensor &a, const sTensor &b)
 
sTensor divide (const sTensor &a, const sTensor &b)
 
sTensor log (const sTensor &a)
 
sTensor multiply (const sTensor &a, float constant)
 
sTensor multiply (const sTensor &a, const sTensor &b)
 
sTensor transpose (const sTensor &a)
 
sTensor relu (const sTensor &a)
 
sTensor sigmoid (const sTensor &a)
 
sTensor no_grad::sum (const sTensor &a)
 
sTensor no_grad::add (const sTensor &a, const sTensor &b)
 
sTensor no_grad::subtract (const sTensor &a, const sTensor &b)
 
sTensor no_grad::hadamard (const sTensor &a, const sTensor &b)
 
sTensor no_grad::divide (const sTensor &a, const sTensor &b)
 
sTensor no_grad::log (const sTensor &a)
 
sTensor no_grad::multiply (const sTensor &a, float constant)
 
sTensor no_grad::multiply (const sTensor &a, const sTensor &b)
 
sTensor no_grad::transpose (const sTensor &a)
 
sTensor no_grad::relu (const sTensor &a)
 
sTensor no_grad::sigmoid (const sTensor &a)
 

Detailed Description

Header file declaring the Tensor class to represent multidimensional arrays.

Author
Jan Warchocki
Date
26 August 2022

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  stream,
const Tensor tensor 
)

Enables the tensor to be printed using std::cout.

Parameters
streamThe stream to print the tensor to.
tensorThe tensor to print.
Returns
The stream with the string representation of the tensor added to it.