File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
python/metatensor-operations/tests Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -276,7 +276,8 @@ def function(array):
276
276
tensor_2 = _gradcheck .cartesian_cubic (array )
277
277
return metatensor .add (tensor_1 , tensor_2 )
278
278
279
- array = np .random .rand (5 , 3 )
279
+ rng = np .random .default_rng (seed = 123456 )
280
+ array = rng .random ((5 , 3 ))
280
281
_gradcheck .check_finite_differences (function , array , parameter = "g" )
281
282
282
283
@@ -287,5 +288,7 @@ def function(array):
287
288
tensor_2 = _gradcheck .cartesian_cubic (array )
288
289
return metatensor .add (tensor_1 , tensor_2 )
289
290
290
- array = torch .rand (5 , 3 , dtype = torch .float64 )
291
+ rng = torch .Generator ()
292
+ rng .manual_seed (123456 )
293
+ array = torch .rand (5 , 3 , dtype = torch .float64 , generator = rng )
291
294
_gradcheck .check_finite_differences (function , array , parameter = "g" )
You can’t perform that action at this time.
0 commit comments