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

Ranges implementation #1266

Open
Sprinzl opened this issue Mar 9, 2024 · 3 comments · May be fixed by #1296
Open

Ranges implementation #1266

Sprinzl opened this issue Mar 9, 2024 · 3 comments · May be fixed by #1296

Comments

@Sprinzl
Copy link

Sprinzl commented Mar 9, 2024

Hello,
Hope this not an error with my code...
So I really like to use ranges. Lets assume tensor of 3 dimensions.
I can do x[some tensor] ....
I can do x[x<=2] ....
I can do x[..int,..,..] .....
What I cannot do is x[..,some tensor,..] ... where some tensor are indices or booleans.
Is where any way to implement this. Would be really cool because this often appears in pythonic code...

Thanks

@shaltielshmid
Copy link
Contributor

Implicit casting could be a cool feature, for now you can work around it by doing:

var indexed = x[..,TensorIndex.Tensor(some_tensor),..];

@yueyinqiu
Copy link
Contributor

yueyinqiu commented Apr 26, 2024

@shaltielshmid So are we facing any problems when implementing the implicit cast (since nobody did it before)?

@shaltielshmid
Copy link
Contributor

I haven't gotten up to it yet, but feel free to go ahead :)

@yueyinqiu yueyinqiu linked a pull request Apr 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants