TVM  0.9.4
Weight.h
Go to the documentation of this file.
1 
3 #pragma once
4 
6 
7 namespace tvm
8 {
9 
10 namespace requirements
11 {
12 
22 template<bool Lightweight = true>
23 class WeightBase : public abstract::SingleSolvingRequirement<double, Lightweight>
24 {
25 public:
27  WeightBase() : abstract::SingleSolvingRequirement<double, Lightweight>(1.0, true) {}
28 
29  WeightBase(double alpha) : abstract::SingleSolvingRequirement<double, Lightweight>(alpha, false)
30  {
31  if(alpha < 0)
32  throw std::runtime_error("weight must be non negative.");
33  }
34 
36 };
37 
39 
40 } // namespace requirements
41 
42 } // namespace tvm
#define TVM_DEFINE_LW_NON_LW_CONVERSION_OPERATORS(className, T, L)
Definition: SingleSolvingRequirement.h:79
Definition: Weight.h:24
WeightBase()
Definition: Weight.h:27
WeightBase(double alpha)
Definition: Weight.h:29
Definition: SingleSolvingRequirement.h:26
SingleSolvingRequirement(const double &val, bool isDefault)
Definition: SingleSolvingRequirement.h:48
Definition: Clock.h:12