@@ -1903,7 +1903,7 @@ def test_interface(self):
1903
1903
)
1904
1904
class TestConv2dGrads :
1905
1905
def setup_method (self ):
1906
- self .random_stream = np .random .RandomState (utt .fetch_seed ())
1906
+ self .random_stream = np .random .default_rng (utt .fetch_seed ())
1907
1907
1908
1908
self .inputs_shapes = [(8 , 1 , 12 , 12 ), (1 , 1 , 5 , 5 ), (1 , 1 , 5 , 6 ), (1 , 1 , 6 , 6 )]
1909
1909
self .filters_shapes = [(5 , 1 , 2 , 2 ), (1 , 1 , 3 , 3 )]
@@ -1928,12 +1928,12 @@ def test_conv2d_grad_wrt_inputs(self):
1928
1928
for bm in self .border_modes :
1929
1929
for ss in self .subsamples :
1930
1930
for ff in self .filter_flip :
1931
- input_val = self .random_stream .random_sample (in_shape ).astype (
1931
+ input_val = self .random_stream .random (in_shape ).astype (
1932
+ config .floatX
1933
+ )
1934
+ filter_val = self .random_stream .random (fltr_shape ).astype (
1932
1935
config .floatX
1933
1936
)
1934
- filter_val = self .random_stream .random_sample (
1935
- fltr_shape
1936
- ).astype (config .floatX )
1937
1937
out_grad_shape = (
1938
1938
aesara .tensor .nnet .abstract_conv .get_conv_output_shape (
1939
1939
image_shape = in_shape ,
@@ -1942,9 +1942,9 @@ def test_conv2d_grad_wrt_inputs(self):
1942
1942
subsample = ss ,
1943
1943
)
1944
1944
)
1945
- out_grad_val = self .random_stream .random_sample (
1946
- out_grad_shape
1947
- ). astype ( config . floatX )
1945
+ out_grad_val = self .random_stream .random ( out_grad_shape ). astype (
1946
+ config . floatX
1947
+ )
1948
1948
conv_out = aesara .tensor .nnet .conv2d (
1949
1949
self .x ,
1950
1950
filters = self .w ,
@@ -1994,12 +1994,12 @@ def test_conv2d_grad_wrt_weights(self):
1994
1994
for bm in self .border_modes :
1995
1995
for ss in self .subsamples :
1996
1996
for ff in self .filter_flip :
1997
- input_val = self .random_stream .random_sample (in_shape ).astype (
1997
+ input_val = self .random_stream .random (in_shape ).astype (
1998
+ config .floatX
1999
+ )
2000
+ filter_val = self .random_stream .random (fltr_shape ).astype (
1998
2001
config .floatX
1999
2002
)
2000
- filter_val = self .random_stream .random_sample (
2001
- fltr_shape
2002
- ).astype (config .floatX )
2003
2003
out_grad_shape = (
2004
2004
aesara .tensor .nnet .abstract_conv .get_conv_output_shape (
2005
2005
image_shape = in_shape ,
@@ -2008,9 +2008,9 @@ def test_conv2d_grad_wrt_weights(self):
2008
2008
subsample = ss ,
2009
2009
)
2010
2010
)
2011
- out_grad_val = self .random_stream .random_sample (
2012
- out_grad_shape
2013
- ). astype ( config . floatX )
2011
+ out_grad_val = self .random_stream .random ( out_grad_shape ). astype (
2012
+ config . floatX
2013
+ )
2014
2014
conv_out = aesara .tensor .nnet .conv2d (
2015
2015
self .x ,
2016
2016
filters = self .w ,
0 commit comments