-
Notifications
You must be signed in to change notification settings - Fork 139
Closed
Labels
Description
We should correct these methods to create the right type of RNG if they are not provided by the user (that's what super().make_node()
) would do anyway
pytensor/pytensor/tensor/random/basic.py
Lines 1914 to 1919 in 237f54f
def make_node(self, rng, *args, **kwargs): | |
if not isinstance( | |
getattr(rng, "type", None), (RandomStateType, RandomStateSharedVariable) | |
): | |
raise TypeError("`randint` is only available for `RandomStateType`s") | |
return super().make_node(rng, *args, **kwargs) |
pytensor/pytensor/tensor/random/basic.py
Lines 1964 to 1970 in 237f54f
def make_node(self, rng, *args, **kwargs): | |
if not isinstance( | |
getattr(rng, "type", None), | |
(RandomGeneratorType, RandomGeneratorSharedVariable), | |
): | |
raise TypeError("`integers` is only available for `RandomGeneratorType`s") | |
return super().make_node(rng, *args, **kwargs) |