MagmaDNN  1.0
c++NeuralNetworkFramework
divop.h File Reference
#include "compute/operation.h"
#include "tensor/tensor.h"
#include "compute/div/div_internal.h"
Include dependency graph for divop.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  magmadnn::op::DivOp< T >
 

Enumerations

enum  div_op_t {
  TENSOR_DIV_TENSOR, SCALAR_DIV_TENSOR, TENSOR_DIV_SCALAR, VEC_DIV_SCALAR,
  SCALAR_DIV_VEC
}
 

Functions

template<typename T >
DivOp< T > * magmadnn::op::div (Operation< T > *a, Operation< T > *b, bool copy, bool needs_grad)
 

Detailed Description

Author
Daniel Nichols
Version
0.1
Date
2019-05-23

Function Documentation

◆ div()

template<typename T >
DivOp< T > * magmadnn::op::div ( Operation< T > *  a,
Operation< T > *  b,
bool  copy,
bool  needs_grad 
)

Divides tensor a by b. There are 3 cases:

  1. a and b share a shape: the element-wise division a/b is performed
  2. a is a scalar: a->get(0) / b is performed
  3. b is a scalar: a / b->get(0) is performed

If a and b do not have the same shape and neither are a scalar, then it is an error.

Template Parameters
Tint float double
Parameters
atensor
btensor
copy
needs_grad
Returns
DivOp<T>* the result of the above cases calculated.