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

Get tensor elements with indices #17

Closed
wavepacket opened this issue Jun 16, 2015 · 1 comment
Closed

Get tensor elements with indices #17

wavepacket opened this issue Jun 16, 2015 · 1 comment

Comments

@wavepacket
Copy link

I have a principally simple problem.

A program reads a tensor from sn sdf file (tensor/sdf.h), and needs a certain element from this tensor, the indices of which are specified on the command line. However, the rank of the tensor may vary. In principle, the generic way to solve this would then be to set up a tensor::Indices object, fill it with the indices and call, e.g., RTensor::operator()(const Indices&).

The problem that I have now is that this function does not exist. To query a tensor element, I therefore need to give the index numbers one by one to specific function, depending on the rank of the tensor. This is an annoying solution and at odds with all other uses of tensor::Indices (e.g., all the tensor creation functions allow tensor::Indices for generalized setup), so maybe the operator() should be added properly.

@juanjosegarciaripoll
Copy link
Owner

Added to cmake branch.

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