Skip to content

Commit dca8843

Browse files
FIX: random.beta fallback (#351)
1 parent 40ede02 commit dca8843

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dpnp/random/dpnp_iface_random.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,23 @@ def beta(a, b, size=None):
136136
# TODO:
137137
# array_like of floats for `a`, `b`
138138
if not use_origin_backend(a) and dpnp_queue_is_cpu():
139-
if size is None:
140-
size = 1
141139
if isinstance(size, tuple):
142140
for dim in size:
143141
if not isinstance(dim, int):
144142
pass
145143
elif not isinstance(size, int):
146144
pass
145+
elif not dpnp.isscalar(a):
146+
pass
147+
elif not dpnp.isscalar(b):
148+
pass
147149
elif a <= 0:
148150
pass
149151
elif b <= 0:
150152
pass
151153
else:
154+
if size is None:
155+
size = 1
152156
return dpnp_beta(a, b, size)
153157

154158
return call_origin(numpy.random.beta, a, b, size)

0 commit comments

Comments
 (0)