public void PrepareToSerialize() { serializableWeightsData = new SerializableWeightsData(); serializableWeightsData.inputSynapsesWeights = inputSynapsesWeights.ToArray(); serializableWeightsData.outputSynapsesWeights = outputSynapsesWeights.ToArray(); serializableWeightsData.hiddenLayerSynapsesWeights = hiddenLayerSynapsesWeights.ToArray(); serializableWeightsData.hiddenLayerBias = hiddenLayerBias.ToArray(); serializableWeightsData.secondHiddenLayerBias = secondHiddenLayerBias.ToArray(); }
public void ToArrayCreatesArrayWithSameElements() { using (NativeArray2D <int> src = CreateArray(2, 3)) { NativeArray2D <int> srcAlias = src; srcAlias[0, 0] = 100; srcAlias[0, 1] = 200; srcAlias[0, 2] = 300; srcAlias[1, 0] = 400; srcAlias[1, 1] = 500; srcAlias[1, 2] = 600; int[,] dest = src.ToArray(); Assert.That(dest[0, 0], Is.EqualTo(src[0, 0])); Assert.That(dest[0, 1], Is.EqualTo(src[0, 1])); Assert.That(dest[0, 2], Is.EqualTo(src[0, 2])); Assert.That(dest[1, 0], Is.EqualTo(src[1, 0])); Assert.That(dest[1, 1], Is.EqualTo(src[1, 1])); Assert.That(dest[1, 2], Is.EqualTo(src[1, 2])); } }