DLPrimitives
Namespaces | Classes | Enumerations | Functions | Variables
dlprim Namespace Reference

Mane namespace. More...

Namespaces

 core
 All Basic Operations on GPU.
 
 cpu
 CPU related tools and classes.
 
 gpu
 GPU Related tools and classes.
 
 json
 This namespace includes all JSON parsing and formatting related classes and functions.
 
 philox
 CPU implementation of Philox 4-32-10 algorithm.
 
 solvers
 Namespace that contains various optimizers.
 

Classes

class  Activation
 
struct  ActivationConfig
 
class  AXPBY
 
class  BatchNorm
 
struct  BatchNormConfig
 
class  BuildError
 Thrown if OpenCL kernel compilation failed. More...
 
class  BWBias
 
class  Concat
 
struct  ConcatConfig
 
class  ConcatSliceBase
 
class  Context
 This is main object that represent the pair of OpenCL platform and device all other objects use it. More...
 
class  Convolution2D
 
class  Convolution2DBase
 
struct  Convolution2DConfig
 
struct  Convolution2DConfigBase
 Convolution settings. More...
 
class  Elementwise
 
struct  ElementwiseConfig
 
class  Error
 Base dlprim excetion. More...
 
class  ExecGuard
 
class  ExecutionContext
 This class is used to pass cl::Events that the kernel should wait for and/or signal event completion. More...
 
class  Flatten
 
struct  FlattenConfig
 
class  GlobalPooling
 
struct  GlobalPoolingConfig
 
class  Hardtanh
 
struct  HardtanhConfig
 
class  InnerProduct
 
struct  InnerProductConfig
 
class  ModelBase
 Base class used for loading non-native model formats to dlprimitives. More...
 
class  MSELoss
 
struct  MSELossConfig
 
class  Net
 Major object used for inference. More...
 
class  NLLLoss
 
struct  NLLLossConfig
 
class  NotImplementedError
 Thrown if some stuff is not implemented yet. More...
 
class  ONNXModel
 External model for loading ONNX models for inference with dlprim. More...
 
class  Operator
 Base class for backward/forward propogation calculations for internal network. More...
 
class  PointwiseBase
 
class  Pooling2D
 
struct  Pooling2DConfig
 
struct  PoolingBase
 
class  RandomState
 
class  Reshape
 
class  ReshapeBase
 
struct  ReshapeConfig
 
class  Scal
 
class  Shape
 Tensor shape. More...
 
class  SharedResource
 Resources shared by the entire network. More...
 
class  Slice
 
struct  SliceConfig
 
class  Softmax
 
class  SoftmaxBase
 
struct  SoftmaxConfig
 
class  SoftmaxWithLoss
 
class  Squeeze
 
struct  SqueezeConfig
 
class  Tensor
 Central Data Contrainer - Tensor. More...
 
struct  TensorAndGradient
 Pair of tensor and its gradient for backpropogation. More...
 
class  TensorSpecs
 Definition of Tensor without actual memory/object. More...
 
class  Threshold
 
struct  ThresholdConfig
 
class  TimingData
 Class used for benchmarking of the model. More...
 
class  TransposedConvolution2D
 
struct  TransposedConvolution2DConfig
 
struct  TypeTraits
 
struct  TypeTraits< double >
 
struct  TypeTraits< float >
 
struct  TypeTraits< int16_t >
 
struct  TypeTraits< int32_t >
 
struct  TypeTraits< int64_t >
 
struct  TypeTraits< int8_t >
 
struct  TypeTraits< uint16_t >
 
struct  TypeTraits< uint32_t >
 
struct  TypeTraits< uint64_t >
 
struct  TypeTraits< uint8_t >
 
class  ValidationError
 Thrown in case of invalid parameters. More...
 

Enumerations

enum  DataType {
  double_data = 4 + (0 << 3), int64_data = 4 + (2 << 3), uint64_data = 4 + (3 << 3), float_data = 3 + (0 << 3),
  int32_data = 3 + (2 << 3), uint32_data = 3 + (3 << 3), half_data = 2 + (0 << 3), bfloat16_data = 2 + (1 << 3),
  int16_data = 2 + (2 << 3), uint16_data = 2 + (3 << 3), int8_data = 1 + (2 << 3), uint8_data = 1 + (3 << 3)
}
 type definition
 
enum  DataTypeLimit { dt_min_val, dt_max_val }
 
enum  StandardActivations : int {
  identity = 0, relu = 1, tanh = 2, sigmoid = 3,
  relu6 = 4
}
 Parameterless Activations that can be embedded to general kernels like inner product or convolution.
 
enum  CalculationsMode { train, predict }
 Operation mode of layers - inference of training.
 
enum  GemmOpMode { forward = 1, backward_filter = 2, backward_data = 3 }
 internal GEMM mode
 

Functions

bool is_floating_point_data_type (DataType d)
 returns true of data is double, float, half or bfloat16 type
 
DataType string_to_data_type (std::string const &s)
 
std::string data_type_to_string (DataType dt)
 
std::string data_type_to_opencl_numeric_limit (DataType dt, DataTypeLimit lmt)
 
std::string data_type_to_opencl_type (DataType dt, bool io_type=false)
 
constexpr int size_of_data_type (DataType d)
 
StandardActivations activation_from_name (std::string const &name)
 
char const * activation_to_name (StandardActivations act)
 
std::string activation_equation (StandardActivations act, std::string const &variable)
 
std::string activation_backward_equation (StandardActivations act, std::string const &dy, std::string const &y)
 
std::unique_ptr< Operatorcreate_by_name (Context &ctx, std::string const &name, json::value const &parameters)
 Factory - generate operator by its name (type) with parameters needed.
 
std::ostream & operator<< (std::ostream &o, Shape const &s)
 
Shape broadcast (Shape const &ain, Shape const &bin)
 calculate numpy style broadcast shape
 
void shrink_broadcast_ranges (std::vector< Shape > &shapes)
 Broadcast shapes numpy style and remove planes that can be merged. More...
 
std::ostream & operator<< (std::ostream &out, TensorSpecs const &ts)
 
std::ostream & operator<< (std::ostream &out, Tensor const &ts)
 
void set_to_zero (Tensor &t, ExecutionContext const &e)
 Set value of t to zero.
 
void set_to_constant (Tensor &t, double value, ExecutionContext const &e)
 Set to constant, value is casted to t.dtype()
 
void set_to_urandom (Tensor &t, RandomState &state, float minv, float maxv, ExecutionContext const &e)
 set t values to uniform random values in range [minv,maxv), seed is updated
 
void set_to_normal (Tensor &t, RandomState &state, float mean, float sigma, ExecutionContext const &e)
 set t values to normal distribution with mean and sigma), seed is updated
 
void set_to_bernoulli (Tensor &t, RandomState &state, float p, ExecutionContext const &e)
 set t values to bernully distribution with mean and sigma), seed is updated
 

Variables

static constexpr int max_tensor_dim = 5
 Maximal number of dimensions in tensor.
 
constexpr int forward_data = 1
 internal flag
 
constexpr int backward_data = 2
 internal flag
 
constexpr int backward_param = 3
 internal flag
 

Detailed Description

Mane namespace.

Function Documentation

void dlprim::shrink_broadcast_ranges ( std::vector< Shape > &  shapes)

Broadcast shapes numpy style and remove planes that can be merged.

For example: shrink([2,3,4],[2,1,1]) -> [2,12],[2,1] shrink([2,3,4],[2,3,4]) -> [24],[24] shrink([2,3,4],[1]) -> [24],[1] shrink([2,3,4],[3,1]) -> [2,3,4],[1,3,1] shrink([2,3,4,5],[3,1,1]) -> [2,3,20],[1,3,1] shrink([2,3,4,5],[1,3,4,1]) -> [2,12,5],[1,12,1]

Referenced by dlprim::Shape::split_and_merge_over_axis().