|
TensorPtr | to (Device const &other) const noexcept |
| Creates a copy of this tensor on the requested device and returns a pointer to it. If the new device is the same as the device the tensor is already on, the tensor will be copied.
|
|
Device const & | device () const noexcept |
| Returns the device this tensor is stored on.
|
|
void | setRequiresGrad (bool requiresGrad) noexcept |
| Set this tensors requirements for a gradient.
|
|
bool | requiresGrad () const noexcept |
| Returns true iff this tensor requires a gradient, i.e., needs to be updated during backpropagation.
|
|
void | backward (bool enableAutodiff=false) noexcept |
|
const TensorPtr & | gradient () const noexcept |
|
void | discardGradient () noexcept |
|
virtual std::ostream & | writeToStream (std::ostream &stream) const noexcept=0 |
|
virtual bool | operator== (const TensorPtr &other) const noexcept=0 |
|
virtual bool | allclose (const TensorPtr &other, float rtol=1e-5, float atol=1e-8) const noexcept=0 |
|
virtual TensorPtr | add (const TensorPtr &other) const noexcept=0 |
|
virtual TensorPtr | sub (const TensorPtr &other) const noexcept=0 |
|
virtual TensorPtr | mul (const TensorPtr &other) const noexcept=0 |
|
virtual TensorPtr | div (const TensorPtr &other) const noexcept=0 |
|
virtual TensorPtr | fma (const TensorPtr &factor, const TensorPtr &summand) const noexcept=0 |
| Performs "fused multiply and add".
|
|
virtual TensorPtr | matmul (const TensorPtr &other) const noexcept=0 |
|
virtual TensorPtr | transpose (std::vector< size_t > &&permutation) const noexcept=0 |
|
virtual TensorPtr | pow (float exponent) const noexcept=0 |
|
virtual TensorPtr | exp () const noexcept=0 |
|
virtual TensorPtr | log () const noexcept=0 |
|
virtual TensorPtr | sqrt () const noexcept=0 |
|
virtual TensorPtr | rsqrt () const noexcept=0 |
|
virtual TensorPtr | mean () const noexcept=0 |
|
virtual TensorPtr | mean (int dim, bool keepdim) const noexcept=0 |
|
virtual TensorPtr | sum () const noexcept=0 |
|
virtual TensorPtr | sum (int dim, bool keepdim) const noexcept=0 |
|
virtual TensorPtr | min () const noexcept=0 |
|
virtual TensorPtr | min (int dim, bool keepdim) const noexcept=0 |
|
virtual TensorPtr | min (const TensorPtr &other) const noexcept=0 |
| Computes the element-wise minimum between this tensor and the other.
|
|
virtual TensorPtr | max () const noexcept=0 |
|
virtual TensorPtr | max (int dim, bool keepdim) const noexcept=0 |
|
virtual TensorPtr | max (const TensorPtr &other) const noexcept=0 |
|
virtual TensorPtr | var (DOF dof) const noexcept=0 |
|
virtual TensorPtr | var (int dim, DOF dof) const noexcept=0 |
|
virtual TensorPtr | erf () const noexcept=0 |
|
virtual void | mul_inplace (const TensorPtr &other) noexcept=0 |
|
virtual void | reshape (SShape shape) noexcept=0 |
| Reshapes the tensor to fit the specified size.
|
|
virtual TensorPtr | clone () const noexcept=0 |
|
virtual Shape | shape () const noexcept=0 |
|
virtual size_t | shape (int dim) const noexcept=0 |
|
size_t | numDim () const noexcept |
|
virtual TensorPtr | flatten () const noexcept=0 |
|
virtual size_t | toBytes (char *buffer, size_t buflen) const noexcept=0 |
| Writes this tensor's data into the byte array.
|
|
Definition at line 13 of file tensorimpl.hpp.