Search in sources :

Example 1 with CompIntFloatRowUpdateSplit

use of com.tencent.angel.psagent.matrix.oplog.cache.CompIntFloatRowUpdateSplit in project angel by Tencent.

the class CompIntFloatVectorSplitter method split.

@Override
public Map<PartitionKey, RowUpdateSplit> split(Vector vector, List<PartitionKey> parts) {
    IntFloatVector[] vecParts = ((CompIntFloatVector) vector).getPartitions();
    assert vecParts.length == parts.size();
    Map<PartitionKey, RowUpdateSplit> updateSplitMap = new HashMap<>(parts.size());
    for (int i = 0; i < vecParts.length; i++) {
        updateSplitMap.put(parts.get(i), new CompIntFloatRowUpdateSplit(vector.getRowId(), vecParts[i], (int) (parts.get(i).getEndCol() - parts.get(i).getStartCol())));
    }
    return updateSplitMap;
}
Also used : CompIntFloatVector(com.tencent.angel.ml.math2.vector.CompIntFloatVector) HashMap(java.util.HashMap) PartitionKey(com.tencent.angel.PartitionKey) RowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit) CompIntFloatRowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.CompIntFloatRowUpdateSplit) CompIntFloatRowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.CompIntFloatRowUpdateSplit) CompIntFloatVector(com.tencent.angel.ml.math2.vector.CompIntFloatVector) IntFloatVector(com.tencent.angel.ml.math2.vector.IntFloatVector)

Aggregations

PartitionKey (com.tencent.angel.PartitionKey)1 CompIntFloatVector (com.tencent.angel.ml.math2.vector.CompIntFloatVector)1 IntFloatVector (com.tencent.angel.ml.math2.vector.IntFloatVector)1 CompIntFloatRowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.CompIntFloatRowUpdateSplit)1 RowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit)1 HashMap (java.util.HashMap)1