@@ -117,7 +117,7 @@ public void Test1DToJuliaString()
117
117
{
118
118
Tensor t = torch . zeros ( 4 ) ;
119
119
var str = t . jlstr ( cultureInfo : CultureInfo . InvariantCulture ) ;
120
- Assert . Equal ( $ "[4], type = Float32, device = cpu\n 0 0 0 0\n ", str ) ;
120
+ Assert . Equal ( $ "[4], type = Float32, device = cpu{ Environment . NewLine } 0 0 0 0{ Environment . NewLine } ", str ) ;
121
121
}
122
122
{
123
123
Tensor t = torch . zeros ( 4 , torch . complex64 ) ;
@@ -151,12 +151,12 @@ public void Test2DToJuliaString()
151
151
{
152
152
Tensor t = torch . tensor ( new float [ ] { 0.0f , 3.141f , 6.2834f , 3.14152f , 6.28e-06f , - 13.141529f , 0.01f , 4713.14f } , 2 , 4 ) ;
153
153
var str = t . str ( cultureInfo : CultureInfo . InvariantCulture ) ;
154
- Assert . Equal ( $ "[2x4], type = Float32, device = cpu\n 0 3.141 6.2834 3.1415\n 6.28e-06 -13.142 0.01 4713.1\n ", str ) ;
154
+ Assert . Equal ( $ "[2x4], type = Float32, device = cpu{ Environment . NewLine } 0 3.141 6.2834 3.1415{ Environment . NewLine } 6.28e-06 -13.142 0.01 4713.1{ Environment . NewLine } ", str ) ;
155
155
}
156
156
if ( torch . cuda . is_available ( ) ) {
157
157
Tensor t = torch . tensor ( new float [ ] { 0.0f , 3.141f , 6.2834f , 3.14152f , 6.28e-06f , - 13.141529f , 0.01f , 4713.14f } , 2 , 4 , device : torch . CUDA ) ;
158
158
var str = t . str ( cultureInfo : CultureInfo . InvariantCulture ) ;
159
- Assert . Equal ( $ "[2x4], type = Float32, device = cuda:0\n 0 3.141 6.2834 3.1415\n 6.28e-06 -13.142 0.01 4713.1\n ", str ) ;
159
+ Assert . Equal ( $ "[2x4], type = Float32, device = cuda:0{ Environment . NewLine } 0 3.141 6.2834 3.1415{ Environment . NewLine } 6.28e-06 -13.142 0.01 4713.1{ Environment . NewLine } ", str ) ;
160
160
}
161
161
{
162
162
Tensor t = torch . tensor ( new float [ ] { 0.0f , 3.141f , 6.2834f , 3.14152f , 6.28e-06f , - 13.141529f , 0.01f , 4713.14f } , 2 , 4 , device : torch . META ) ;
@@ -187,7 +187,8 @@ public void Test3DToJuliaString()
187
187
var str = t . jlstr ( "0.0000000" , cultureInfo : CultureInfo . InvariantCulture ) ;
188
188
Assert . Equal ( $ "[2x2x4], type = Float32, device = cpu\n [0,..,..] =\n 0.0000000 3.1410000 6.2834000 3.1415200\n " +
189
189
$ " 0.0000063 -13.1415300 0.0100000 4713.1400000\n \n [1,..,..] =\n 0.0100000 0.0000000 0.0000000 0.0000000\n " +
190
- $ " 0.0000000 0.0000000 0.0000000 0.0000000\n ", str ) ;
190
+ $ " 0.0000000 0.0000000 0.0000000 0.0000000\n ". Replace ( "\n " , Environment . NewLine ) ,
191
+ str ) ;
191
192
}
192
193
}
193
194
0 commit comments