File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 19
19
from pytensor .printing import debugprint
20
20
from pytensor .tensor .math import dot , tanh
21
21
from pytensor .tensor .math import sum as pt_sum
22
+ from pytensor .tensor .random import normal
23
+ from pytensor .tensor .random .type import random_generator_type
22
24
from pytensor .tensor .type import (
23
25
dmatrix ,
24
26
dscalar ,
@@ -1280,3 +1282,15 @@ def test_empty_givens_updates():
1280
1282
y = x * 2
1281
1283
function ([In (x )], y , givens = {})
1282
1284
function ([In (x )], y , updates = {})
1285
+
1286
+
1287
+ @pytest .mark .parametrize ("trust_input" , [True , False ])
1288
+ def test_minimal_random_function_call_benchmark (trust_input , benchmark ):
1289
+ rng = random_generator_type ()
1290
+ x = normal (rng = rng , size = (100 ,))
1291
+
1292
+ f = function ([In (rng , mutable = True )], x )
1293
+ f .trust_input = trust_input
1294
+
1295
+ rng_val = np .random .default_rng ()
1296
+ benchmark (f , rng_val )
You can’t perform that action at this time.
0 commit comments