Commit f93ee49c authored by Davis King's avatar Davis King

Made requires clause a little more sensible.

parent 12bc559d
......@@ -75,10 +75,13 @@ namespace dlib
void set_num_filters(long num)
{
DLIB_CASSERT(num > 0);
if (num != num_filters_)
{
DLIB_CASSERT(get_layer_params().size() == 0,
"You can't change the number of filters in con_ if the parameter tensor has already been allocated.");
num_filters_ = num;
}
}
double get_learning_rate_multiplier () const { return learning_rate_multiplier; }
double get_weight_decay_multiplier () const { return weight_decay_multiplier; }
......@@ -371,10 +374,13 @@ namespace dlib
void set_num_filters(long num)
{
DLIB_CASSERT(num > 0);
if (num != num_filters_)
{
DLIB_CASSERT(get_layer_params().size() == 0,
"You can't change the number of filters in cont_ if the parameter tensor has already been allocated.");
num_filters_ = num;
}
}
double get_learning_rate_multiplier () const { return learning_rate_multiplier; }
double get_weight_decay_multiplier () const { return weight_decay_multiplier; }
......
......@@ -730,7 +730,7 @@ namespace dlib
/*!
requires
- num > 0
- get_layer_params().size() == 0
- get_layer_params().size() == 0 || num_filters() == num
(i.e. You can't change the number of filters in con_ if the parameter
tensor has already been allocated.)
ensures
......@@ -974,7 +974,7 @@ namespace dlib
/*!
requires
- num > 0
- get_layer_params().size() == 0
- get_layer_params().size() == 0 || num_filters() == num
(i.e. You can't change the number of filters in cont_ if the parameter
tensor has already been allocated.)
ensures
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment