funsor
funsor copied to clipboard
Casting between real and bint
Is there currently a way to cast a funsor with real output to bint? Or vice versa? This would be particularly useful for indexing.
For Tensor and Number you can pull out the data and re-wrap in a funsor. That is indeed hacky, and we do not have first class support for casting.
@bogiebro can you say more about your use case? Maybe give some example code?
I'd like to support your casting usage. I think we could generalize the scalar type Bint[n] to a type of homogeneously-bounded arrays Bints[(n,) + shape], and maybe later to an array type like Array[dtype, shape] (encompassing both Reals[-] and Bints[-]), maybe even similar to NumPy's ArrayLike.