Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casting between real and bint #348

Open
samanklesaria opened this issue Aug 7, 2020 · 2 comments
Open

Casting between real and bint #348

samanklesaria opened this issue Aug 7, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@samanklesaria
Copy link
Contributor

Is there currently a way to cast a funsor with real output to bint? Or vice versa? This would be particularly useful for indexing.

@fritzo
Copy link
Member

fritzo commented Aug 8, 2020

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.

@fritzo fritzo added the enhancement New feature or request label Aug 18, 2020
@fritzo
Copy link
Member

fritzo commented Aug 18, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants