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

How to implement the torch.gather function? #35

Open
findmyway opened this issue Aug 17, 2020 · 1 comment
Open

How to implement the torch.gather function? #35

findmyway opened this issue Aug 17, 2020 · 1 comment

Comments

@findmyway
Copy link
Contributor

With Array in Julia, I can use m[[CartesianIndex(1,1), CartesianIndex(2,1)]] to get the required elements. But with the Tensor in Torch.jl I only get ERROR: getindex not defined for Tensor{Float32,2}

@DhairyaLGandhi
Copy link
Member

Currently getindex has been commented out in favour of keeping the implementation from going to slow fallbacks. This can be done fairly easily via views on the tensor. So a getindex operation can create a copy of a view.

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

No branches or pull requests

2 participants