Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmada committed Jan 4, 2024
1 parent c16963c commit 0ac23b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NetFabric.Numerics.Tensors.UnitTests/SumTripletsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void SumTriplets_Float_Should_Succeed(int count)
var source = Enumerable.Range(0, count)
.Select(value => ((float)value, (float)(value + 1), (float)(value + 2)))
.ToArray();
var expected = source.Aggregate((0f, 0f, 0f), (sum, value) => (sum.Item1 + value.Item1, sum.Item2 + value.Item2, sum.Item3 + value.Item3));
var expected = source.Aggregate((0.0f, 0.0f, 0.0f), (sum, value) => (sum.Item1 + value.Item1, sum.Item2 + value.Item2, sum.Item3 + value.Item3));

// act
var result = Tensor.SumTriplets<float>(MemoryMarshal.Cast<ValueTuple<float, float, float>, float>(source));
Expand All @@ -92,7 +92,7 @@ public void SumTriplets_Double_Should_Succeed(int count)
var source = Enumerable.Range(0, count)
.Select(value => ((double)value, (double)(value + 1), (double)(value + 2)))
.ToArray();
var expected = source.Aggregate((0d, 0d, 0d), (sum, value) => (sum.Item1 + value.Item1, sum.Item2 + value.Item2, sum.Item3 + value.Item3));
var expected = source.Aggregate((0.0d, 0.0d, 0.0d), (sum, value) => (sum.Item1 + value.Item1, sum.Item2 + value.Item2, sum.Item3 + value.Item3));

// act
var result = Tensor.SumTriplets<double>(MemoryMarshal.Cast<ValueTuple<double, double, double>, double>(source));
Expand Down

0 comments on commit 0ac23b1

Please sign in to comment.