source/train/XWorkerBroadcast.cpp
void XWorkerBroadcast::BroadcastData(XTensorKeeper * source, XList * targetList)
{
    CheckNTErrors(source->flag == PARAM_STATE_UPDATED,
                  "The parameter is not ready for broadcasting");

    for (int i = 0; i < targetList->count; i++) {
        XTensorKeeper * target = (XTensorKeeper*)targetList->GetItem(i);

        /* data transmit */
        BroadcastP2P(source->tensor, target->tensor);

        /* update the flag */
        target->flag = PARAM_STATE_UPDATED;
    }
}
/* 
broadcast data for a parameter 
>> source - the data (as a model) that we want to broadcast
>> targetList - the target places where we recieve the data
*/
broadcast data for a parameter
>> source - the data (as a model) that we want to broadcast
>> targetList - the target places where we recieve the data
broadcast data for a parameter >> source - the data ( as a model ) that we want to broadcast >> targetList - the target places where we recieve the data
void XWorkerBroadcast::BroadcastData(XTensorKeeper * source, XList * targetList)
{
    CheckNTErrors(source->flag == PARAM_STATE_UPDATED,
                  "The parameter is not ready for broadcasting");
    for (int i = 0; i < targetList->count; i++) {
        XTensorKeeper * target = (XTensorKeeper*)targetList->GetItem(i);
        BroadcastP2P(source->tensor, target->tensor);
        target->flag = PARAM_STATE_UPDATED;
    }
}
void XWorkerBroadcast :: BroadcastData ( XTensorKeeper * source , XList * targetList ) { CheckNTErrors ( source -> flag == PARAM_STATE_UPDATED , " " ) ; for ( int i = 0 ; i < targetList -> count ; i ++ ) { XTensorKeeper * target = ( XTensorKeeper * ) targetList -> GetItem ( i ) ; BroadcastP2P ( source -> tensor , target -> tensor ) ; target -> flag = PARAM_STATE_UPDATED ; } }
broadcast data for a parameter
>> source - the data (as a model) that we want to broadcast
>> targetList - the target places where we recieve the data
broadcast data for a parameter >> source - the data ( as a model ) that we want to broadcast >> targetList - the target places where we recieve the data
/* data transmit */ /* update the flag */