@@ -983,6 +983,7 @@ def generate_samples(generator, *args, **kwargs):
983
983
Any remaining args and kwargs are passed on to the generator function.
984
984
"""
985
985
dist_shape = kwargs .pop ("dist_shape" , ())
986
+ # TODO: the following variable is no longer used !!
986
987
one_d = _is_one_d (dist_shape )
987
988
size = kwargs .pop ("size" , None )
988
989
broadcast_shape = kwargs .pop ("broadcast_shape" , None )
@@ -1059,23 +1060,5 @@ def generate_samples(generator, *args, **kwargs):
1059
1060
samples = generator (size = dist_bcast_shape , * args , ** kwargs )
1060
1061
else :
1061
1062
samples = generator (size = size_tup + dist_bcast_shape , * args , ** kwargs )
1062
- samples = np .asarray (samples )
1063
1063
1064
- # reshape samples here
1065
- if samples .ndim > 0 and samples .shape [0 ] == 1 and size_tup == (1 ,):
1066
- if (
1067
- len (samples .shape ) > len (dist_shape )
1068
- and samples .shape [- len (dist_shape ) :] == dist_shape [- len (dist_shape ) :]
1069
- ):
1070
- raise ValueError (f"This SHOULD be unreachable code. DON'T MERGE UNTIL THIS ENTIRE BLOCK WAS REMOVED. { samples .shape } , { size_tup } " )
1071
- samples = samples .reshape (samples .shape [1 :])
1072
-
1073
- if (
1074
- one_d
1075
- and samples .ndim > 0
1076
- and samples .shape [- 1 ] == 1
1077
- and (samples .shape != size_tup or size_tup == tuple () or size_tup == (1 ,))
1078
- ):
1079
- raise ValueError (f"This SHOULD be unreachable code. DON'T MERGE UNTIL THIS ENTIRE BLOCK WAS REMOVED. { samples .shape } , { size_tup } " )
1080
- samples = samples .reshape (samples .shape [:- 1 ])
1081
1064
return np .asarray (samples )
0 commit comments