DLPrimitives
bias.hpp
1 #pragma once
2 #include <dlprim/tensor.hpp>
3 #include <dlprim/context.hpp>
4 namespace dlprim {
5 namespace core {
10  public:
11  virtual ~BiasBackwardFilter() {}
15  virtual size_t workspace() = 0;
21  virtual void enqueue(Tensor &dy,Tensor &dw,Tensor &ws,float beta,ExecutionContext const &e) = 0;
27  static std::unique_ptr<BiasBackwardFilter> create(Context &ctx,Shape const &dy_shape,DataType dt=float_data);
28  };
29 
33  void add_bias(Tensor &t,Tensor &b,ExecutionContext const &e);
34 } // core
35 } // dlprim
Calculate filter.
Definition: bias.hpp:9
Tensor shape.
Definition: shape.hpp:18
void add_bias(Tensor &t, Tensor &b, ExecutionContext const &e)
Add bias to t over dimentsion 1: t[:,i,:,:] = b[i].
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
virtual void enqueue(Tensor &dy, Tensor &dw, Tensor &ws, float beta, ExecutionContext const &e)=0
make sure you provide worksapce of size workspace() for operations
Mane namespace.
Definition: context.hpp:9
Central Data Contrainer - Tensor.
Definition: tensor.hpp:99
virtual size_t workspace()=0
return required workspace size in bytes
static std::unique_ptr< BiasBackwardFilter > create(Context &ctx, Shape const &dy_shape, DataType dt=float_data)
Create operator for backward bias calculation. dy_shape is the shape of output tesnor for IP it shoul...
This class is used to pass cl::Events that the kernel should wait for and/or signal event completion...
Definition: context.hpp:121