File tree 1 file changed +35
-0
lines changed 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,41 @@ using Metal: storagemode
211
211
@test storagemode (lua. factors) == storagemode (lua. ipiv) == storagemode (A)
212
212
end
213
213
214
+ @testset " solves" begin
215
+ b = MtlVector (rand (Float32, 1024 ))
216
+ B = MtlMatrix (rand (Float32, 1024 , 1024 ))
217
+
218
+ A = MtlMatrix (rand (Float32, 1024 , 512 ))
219
+ x = lu (A) \ b
220
+ @test A * x ≈ b
221
+ X = lu (A) \ B
222
+ @test A * X ≈ B
223
+
224
+ A = UpperTriangular (MtlMatrix (rand (Float32, 1024 , 1024 )))
225
+ x = A \ b
226
+ @test A * x ≈ b
227
+ X = A \ B
228
+ @test A * X ≈ B
229
+
230
+ A = UnitUpperTriangular (MtlMatrix (rand (Float32, 1024 , 1024 )))
231
+ x = A \ b
232
+ @test A * x ≈ b
233
+ X = A \ B
234
+ @test A * X ≈ B
235
+
236
+ A = LowerTriangular (MtlMatrix (rand (Float32, 1024 , 1024 )))
237
+ x = A \ b
238
+ @test A * x ≈ b
239
+ X = A \ B
240
+ @test A * X ≈ B
241
+
242
+ A = UnitLowerTriangular (MtlMatrix (rand (Float32, 1024 , 1024 )))
243
+ x = A \ b
244
+ @test A * x ≈ b
245
+ X = A \ B
246
+ @test A * X ≈ B
247
+ end
248
+
214
249
using . MPS: MPSMatrixSoftMax, MPSMatrixLogSoftMax
215
250
@testset " MPSMatrixSoftMax" begin
216
251
cols = rand (Int)
You can’t perform that action at this time.
0 commit comments