@@ -55,8 +55,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55
55
#define LOG_BLOB (layer, blob, part, blob_id, description ) \
56
56
do \
57
57
{ \
58
- int elems_to_log = std::min (MAX_ELEMS_TO_LOG, blob->count ()); \
59
- for (int idx = 0 ; idx < elems_to_log; idx++) \
58
+ long elems_to_log = std::min (static_cast < long >( MAX_ELEMS_TO_LOG) , blob->count ()); \
59
+ for (long idx = 0 ; idx < elems_to_log; idx++) \
60
60
{ \
61
61
LOG_LAYER (layer) << description \
62
62
<< " , blob_id " << blob_id \
@@ -68,8 +68,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
68
68
#define LOG_PARAM_BLOB (blob, part, blob_id, description ) \
69
69
do \
70
70
{ \
71
- int elems_to_log = std::min (MAX_ELEMS_TO_LOG, blob->count ()); \
72
- for (int idx = 0 ; idx < elems_to_log; idx++) \
71
+ long elems_to_log = std::min (static_cast < long >( MAX_ELEMS_TO_LOG) , blob->count ()); \
72
+ for (long idx = 0 ; idx < elems_to_log; idx++) \
73
73
{ \
74
74
DLOG (INFO) << description \
75
75
<< " , blob_id " << blob_id \
@@ -521,7 +521,12 @@ class Layer {
521
521
CHECK_EQ (top.size (), num_loss_weights) << " loss_weight must be "
522
522
" unspecified or specified once per top blob." ;
523
523
for (int top_id = 0 ; top_id < top.size (); ++top_id) {
524
+ #ifdef USE_MLSL
525
+ const Dtype loss_weight = layer_param_.loss_weight (top_id) /
526
+ GetDistribution ().get_data_parts ();
527
+ #else
524
528
const Dtype loss_weight = layer_param_.loss_weight (top_id);
529
+ #endif
525
530
if (loss_weight == Dtype (0 )) { continue ; }
526
531
this ->set_loss (top_id, loss_weight);
527
532
const int count = top[top_id]->count ();
0 commit comments