@@ -69,8 +69,8 @@ class Discrete(AbstractSpace[Int[Array, ""]]):
6969 def __init__ (self , n : Int [ArrayLike , "" ], start : Int [ArrayLike , "" ] = 0 ):
7070 assert n > 0 , "n must be positive" # pyright: ignore
7171
72- self ._n = jnp .asarray ( n )
73- self .start = jnp .asarray (start )
72+ self ._n = jnp .array ( n , dtype = float )
73+ self .start = jnp .array (start , dtype = float )
7474
7575 @property
7676 def n (self ) -> Int [Array , "" ]:
@@ -133,8 +133,8 @@ def __init__(
133133 high : Float [ArrayLike , " ..." ],
134134 shape : tuple [int , ...] | None = None ,
135135 ):
136- low = jnp .asarray (low )
137- high = jnp .asarray (high )
136+ low = jnp .asarray (low , dtype = float )
137+ high = jnp .asarray (high , dtype = float )
138138 if shape is None :
139139 low , high = jnp .broadcast_arrays (low , high )
140140 shape = low .shape
@@ -361,8 +361,8 @@ def __init__(self, ns: tuple[int, ...], starts: tuple[int, ...] = (0,)):
361361 assert len (ns ) == len (starts ), "ns and starts must have the same length"
362362 assert all (n > 0 for n in ns ), "all n must be positive"
363363
364- self .ns = jnp .asarray (ns )
365- self .starts = jnp .asarray (starts )
364+ self .ns = jnp .array (ns , dtype = float )
365+ self .starts = jnp .array (starts , dtype = float )
366366
367367 @property
368368 def shape (self ) -> tuple [int , ...]:
0 commit comments