@@ -59,7 +59,7 @@ public static void AddTwoTensors(int tensorLength)
5959
6060 for ( int i = 0 ; i < tensorLength ; i ++ )
6161 {
62- Assert . Equal ( x [ i ] + y [ i ] , destination [ i ] ) ;
62+ Assert . Equal ( x [ i ] + y [ i ] , destination [ i ] , Tolerance ) ;
6363 }
6464 }
6565
@@ -97,7 +97,7 @@ public static void AddTensorAndScalar(int tensorLength)
9797
9898 for ( int i = 0 ; i < tensorLength ; i ++ )
9999 {
100- Assert . Equal ( x [ i ] + y , destination [ i ] ) ;
100+ Assert . Equal ( x [ i ] + y , destination [ i ] , Tolerance ) ;
101101 }
102102 }
103103
@@ -124,7 +124,7 @@ public static void SubtractTwoTensors(int tensorLength)
124124
125125 for ( int i = 0 ; i < tensorLength ; i ++ )
126126 {
127- Assert . Equal ( x [ i ] - y [ i ] , destination [ i ] ) ;
127+ Assert . Equal ( x [ i ] - y [ i ] , destination [ i ] , Tolerance ) ;
128128 }
129129 }
130130
@@ -162,7 +162,7 @@ public static void SubtractTensorAndScalar(int tensorLength)
162162
163163 for ( int i = 0 ; i < tensorLength ; i ++ )
164164 {
165- Assert . Equal ( x [ i ] - y , destination [ i ] ) ;
165+ Assert . Equal ( x [ i ] - y , destination [ i ] , Tolerance ) ;
166166 }
167167 }
168168
@@ -189,7 +189,7 @@ public static void MultiplyTwoTensors(int tensorLength)
189189
190190 for ( int i = 0 ; i < tensorLength ; i ++ )
191191 {
192- Assert . Equal ( x [ i ] * y [ i ] , destination [ i ] ) ;
192+ Assert . Equal ( x [ i ] * y [ i ] , destination [ i ] , Tolerance ) ;
193193 }
194194 }
195195
@@ -227,7 +227,7 @@ public static void MultiplyTensorAndScalar(int tensorLength)
227227
228228 for ( int i = 0 ; i < tensorLength ; i ++ )
229229 {
230- Assert . Equal ( x [ i ] * y , destination [ i ] ) ;
230+ Assert . Equal ( x [ i ] * y , destination [ i ] , Tolerance ) ;
231231 }
232232 }
233233
@@ -254,7 +254,7 @@ public static void DivideTwoTensors(int tensorLength)
254254
255255 for ( int i = 0 ; i < tensorLength ; i ++ )
256256 {
257- Assert . Equal ( x [ i ] / y [ i ] , destination [ i ] ) ;
257+ Assert . Equal ( x [ i ] / y [ i ] , destination [ i ] , Tolerance ) ;
258258 }
259259 }
260260
@@ -292,7 +292,7 @@ public static void DivideTensorAndScalar(int tensorLength)
292292
293293 for ( int i = 0 ; i < tensorLength ; i ++ )
294294 {
295- Assert . Equal ( x [ i ] / y , destination [ i ] ) ;
295+ Assert . Equal ( x [ i ] / y , destination [ i ] , Tolerance ) ;
296296 }
297297 }
298298
@@ -318,7 +318,7 @@ public static void NegateTensor(int tensorLength)
318318
319319 for ( int i = 0 ; i < tensorLength ; i ++ )
320320 {
321- Assert . Equal ( - x [ i ] , destination [ i ] ) ;
321+ Assert . Equal ( - x [ i ] , destination [ i ] , Tolerance ) ;
322322 }
323323 }
324324
@@ -345,7 +345,7 @@ public static void AddTwoTensorsAndMultiplyWithThirdTensor(int tensorLength)
345345
346346 for ( int i = 0 ; i < tensorLength ; i ++ )
347347 {
348- Assert . Equal ( ( x [ i ] + y [ i ] ) * multiplier [ i ] , destination [ i ] ) ;
348+ Assert . Equal ( ( x [ i ] + y [ i ] ) * multiplier [ i ] , destination [ i ] , Tolerance ) ;
349349 }
350350 }
351351
@@ -398,7 +398,7 @@ public static void AddTwoTensorsAndMultiplyWithScalar(int tensorLength)
398398
399399 for ( int i = 0 ; i < tensorLength ; i ++ )
400400 {
401- Assert . Equal ( ( x [ i ] + y [ i ] ) * multiplier , destination [ i ] ) ;
401+ Assert . Equal ( ( x [ i ] + y [ i ] ) * multiplier , destination [ i ] , Tolerance ) ;
402402 }
403403 }
404404
@@ -439,7 +439,7 @@ public static void AddTensorAndScalarAndMultiplyWithTensor(int tensorLength)
439439
440440 for ( int i = 0 ; i < tensorLength ; i ++ )
441441 {
442- Assert . Equal ( ( x [ i ] + y ) * multiplier [ i ] , destination [ i ] ) ;
442+ Assert . Equal ( ( x [ i ] + y ) * multiplier [ i ] , destination [ i ] , Tolerance ) ;
443443 }
444444 }
445445
@@ -480,7 +480,7 @@ public static void MultiplyTwoTensorsAndAddWithThirdTensor(int tensorLength)
480480
481481 for ( int i = 0 ; i < tensorLength ; i ++ )
482482 {
483- Assert . Equal ( ( x [ i ] * y [ i ] ) + addend [ i ] , destination [ i ] ) ;
483+ Assert . Equal ( ( x [ i ] * y [ i ] ) + addend [ i ] , destination [ i ] , Tolerance ) ;
484484 }
485485 }
486486
@@ -533,7 +533,7 @@ public static void MultiplyTwoTensorsAndAddWithScalar(int tensorLength)
533533
534534 for ( int i = 0 ; i < tensorLength ; i ++ )
535535 {
536- Assert . Equal ( ( x [ i ] * y [ i ] ) + addend , destination [ i ] ) ;
536+ Assert . Equal ( ( x [ i ] * y [ i ] ) + addend , destination [ i ] , Tolerance ) ;
537537 }
538538 }
539539
@@ -562,7 +562,7 @@ public static void MultiplyTensorAndScalarAndAddWithTensor(int tensorLength)
562562
563563 for ( int i = 0 ; i < tensorLength ; i ++ )
564564 {
565- Assert . Equal ( ( x [ i ] * y ) + addend [ i ] , destination [ i ] ) ;
565+ Assert . Equal ( ( x [ i ] * y ) + addend [ i ] , destination [ i ] , Tolerance ) ;
566566 }
567567 }
568568
@@ -589,7 +589,7 @@ public static void ExpTensor(int tensorLength)
589589
590590 for ( int i = 0 ; i < tensorLength ; i ++ )
591591 {
592- Assert . Equal ( MathF . Exp ( x [ i ] ) , destination [ i ] ) ;
592+ Assert . Equal ( MathF . Exp ( x [ i ] ) , destination [ i ] , Tolerance ) ;
593593 }
594594 }
595595
@@ -614,7 +614,7 @@ public static void LogTensor(int tensorLength)
614614
615615 for ( int i = 0 ; i < tensorLength ; i ++ )
616616 {
617- Assert . Equal ( MathF . Log ( x [ i ] ) , destination [ i ] ) ;
617+ Assert . Equal ( MathF . Log ( x [ i ] ) , destination [ i ] , Tolerance ) ;
618618 }
619619 }
620620
@@ -664,7 +664,7 @@ public static void CoshTensor(int tensorLength)
664664
665665 for ( int i = 0 ; i < tensorLength ; i ++ )
666666 {
667- Assert . Equal ( MathF . Cosh ( x [ i ] ) , destination [ i ] ) ;
667+ Assert . Equal ( MathF . Cosh ( x [ i ] ) , destination [ i ] , Tolerance ) ;
668668 }
669669 }
670670
@@ -689,7 +689,7 @@ public static void SinhTensor(int tensorLength)
689689
690690 for ( int i = 0 ; i < tensorLength ; i ++ )
691691 {
692- Assert . Equal ( MathF . Sinh ( x [ i ] ) , destination [ i ] ) ;
692+ Assert . Equal ( MathF . Sinh ( x [ i ] ) , destination [ i ] , Tolerance ) ;
693693 }
694694 }
695695
@@ -714,7 +714,7 @@ public static void TanhTensor(int tensorLength)
714714
715715 for ( int i = 0 ; i < tensorLength ; i ++ )
716716 {
717- Assert . Equal ( MathF . Tanh ( x [ i ] ) , destination [ i ] ) ;
717+ Assert . Equal ( MathF . Tanh ( x [ i ] ) , destination [ i ] , Tolerance ) ;
718718 }
719719 }
720720
0 commit comments