public WeightDefinitionBag(bool rowMajor, params NeuroWeight <T>[] weights) { _disposed = false; var matrices = new Matrix <T> [weights.Length * 5]; int cnt = -1; for (int i = 0; i < weights.Length; i++) { var weigth = weights[i]; matrices[++cnt] = weigth.Weight; matrices[++cnt] = weigth.Gradient; matrices[++cnt] = weigth.Cache1; matrices[++cnt] = weigth.Cache2; matrices[++cnt] = weigth.CacheM; } _ptrs = new MatrixPointersBag <T>(rowMajor, false, matrices); _defs = new WeightDefinition[weights.Length]; cnt = -1; for (int i = 0; i < weights.Length; i++) { var weight = weights[i]; _defs[i] = new WeightDefinition(weight.Weight.RowCount, weight.Weight.ColumnCount, 1, _ptrs[++cnt], _ptrs[++cnt], _ptrs[++cnt], _ptrs[++cnt], _ptrs[++cnt]); // Oh yeah. } }
public override void TestWeightTransferRowMajor(WeightDefinition weight) { Testing.TestWeightTransferRowMajorCpu(weight); }
public static extern void TestComplexWeightTransferRowMajor(WeightDefinition weight);
public abstract void TestWeightTransferRowMajor(WeightDefinition weight);
public static extern void TestWeightTransferRowMajorGpu(WeightDefinition weight);