2 #include <dlprim/operator.hpp> 4 namespace json {
class value; }
6 class PointwiseOperationBroadcastReduce;
15 Operation op = elementwise_sum;
16 float coeff[2] = {1.0f,1.0f};
33 virtual void setup(std::vector<TensorSpecs>
const &in,
34 std::vector<TensorSpecs> &out,
35 std::vector<TensorSpecs> ¶meters,
38 virtual void reshape(std::vector<Shape>
const &in,
39 std::vector<Shape> &out,
42 virtual void forward(std::vector<Tensor> &input,
43 std::vector<Tensor> &output,
44 std::vector<Tensor> ¶meters,
48 virtual void backward(std::vector<TensorAndGradient> &input,
49 std::vector<TensorAndGradient> &output,
50 std::vector<TensorAndGradient> ¶meters,
63 template<
int dim,
typename F>
64 void loop_strides_dim(
Shape s,
float *a,
Shape a_strides,
float *b,
Shape b_strides,
float *c,F
const &func);
67 void loop_strides(
Shape s,
float *a,
Shape a_strides,
float *b,
Shape b_strides,
float *c,F
const &func);
69 template<
typename F,
typename R>
70 void loops_reduce(
Shape s,
float *a,
Shape as,
float *r,
Shape rs,F
const &func,R
const &reduce);
71 template<
typename F,
typename R>
72 void loops_reduce(
Shape s,
float *a,
Shape as,
float *b,
Shape bs,
float *r,
Shape rs,F
const &func,R
const &reduce);
73 template<
typename F,
typename R>
74 void loops_reduce(
Shape s,
float *a,
Shape as,
float *b,
Shape bs,
float *c,
Shape cs,
float *r,
Shape rs,F
const &func,R
const &reduce);
77 template<
int dim,
typename F,
typename R>
78 void loops_reduce_dim(
Shape s,
float *a,
Shape as,
float *r,
Shape rs,F
const &func,R
const &reduce);
79 template<
int dim,
typename F,
typename R>
80 void loops_reduce_dim(
Shape s,
float *a,
Shape as,
float *b,
Shape bs,
float *r,
Shape rs,F
const &func,R
const &reduce);
81 template<
int dim,
typename F,
typename R>
82 void loops_reduce_dim(
Shape s,
float *a,
Shape as,
float *b,
Shape bs,
float *c,
Shape cs,
float *r,
Shape rs,F
const &func,R
const &reduce);
100 void setup_bwd_gpu(std::vector<TensorSpecs>
const &in,std::vector<TensorSpecs> &out,
size_t &ws);
104 std::unique_ptr<core::PointwiseOperationBroadcastReduce> bwd_l_,bwd_r_,bwd_both_;
Tensor shape.
Definition: shape.hpp:18
virtual char const * operator_type() const
name of the operator type
Definition: elementwise.hpp:28
Definition: elementwise.hpp:8
Base class for backward/forward propogation calculations for internal network.
Definition: operator.hpp:15
This is main object that represent the pair of OpenCL platform and device all other objects use it...
Definition: context.hpp:302
DataType
type definition
Definition: definitions.hpp:70
This class is central representation of json objects.
Definition: json.hpp:652
Mane namespace.
Definition: context.hpp:9
Central Data Contrainer - Tensor.
Definition: tensor.hpp:99
StandardActivations
Parameterless Activations that can be embedded to general kernels like inner product or convolution...
Definition: definitions.hpp:266
Definition: elementwise.hpp:22
This class is used to pass cl::Events that the kernel should wait for and/or signal event completion...
Definition: context.hpp:121