@@ -55,8 +55,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5555#define LOG_BLOB (layer, blob, part, blob_id, description ) \
5656 do \
5757 { \
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++) \
6060 { \
6161 LOG_LAYER (layer) << description \
6262 << " , blob_id " << blob_id \
@@ -68,8 +68,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6868#define LOG_PARAM_BLOB (blob, part, blob_id, description ) \
6969 do \
7070 { \
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++) \
7373 { \
7474 DLOG (INFO) << description \
7575 << " , blob_id " << blob_id \
@@ -521,7 +521,12 @@ class Layer {
521521 CHECK_EQ (top.size (), num_loss_weights) << " loss_weight must be "
522522 " unspecified or specified once per top blob." ;
523523 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
524528 const Dtype loss_weight = layer_param_.loss_weight (top_id);
529+ #endif
525530 if (loss_weight == Dtype (0 )) { continue ; }
526531 this ->set_loss (top_id, loss_weight);
527532 const int count = top[top_id]->count ();
0 commit comments