def prepare_sparse_params(self, param_rowids):
        '''Prepares the module for processing a data batch by pulling row_sparse
        parameters from kvstore to all devices based on rowids.

        Parameters
        ----------
        param_rowids : dict of str to NDArray of list of NDArrays
        '''
        if not self._kvstore:
            return
        assert(isinstance(param_rowids, dict))
        for param_name, rowids in param_rowids.items():
            if isinstance(rowids, (tuple, list)):
                rowids_1d = []
                for r in rowids:
                    rowids_1d.append(r.reshape((-1,)).astype(np.int64))
                rowid = mx.nd.concat(*rowids_1d, dim=0)
            else:
                rowid = rowids
            param_idx = self._exec_group.param_names.index(param_name)
            param_val = self._exec_group.param_arrays[param_idx]
            self._kvstore.row_sparse_pull(param_name, param_val, row_ids=rowid,
                                          priority=-param_idx)
def prepare_sparse_params ( self , param_rowids ) : if not self . _kvstore : return assert ( isinstance ( param_rowids , dict ) ) for param_name , rowids in param_rowids . items ( ) : if isinstance ( rowids , ( tuple , list ) ) : rowids_1d = [ ] for r in rowids : rowids_1d . append ( r . reshape ( ( - 1 , ) ) . astype ( np . int64 ) ) rowid = mx . nd . concat ( * rowids_1d , dim = 0 ) else : rowid = rowids param_idx = self . _exec_group . param_names . index ( param_name ) param_val = self . _exec_group . param_arrays [ param_idx ] self . _kvstore . row_sparse_pull ( param_name , param_val , row_ids = rowid , priority = - param_idx )
Prepares the module for processing a data batch by pulling row_sparse
        parameters from kvstore to all devices based on rowids.

        Parameters
        ----------
        param_rowids : dict of str to NDArray of list of NDArrays