Views on tensor, aka subtensor #182
Unanswered
dmenendez-gruposantander
asked this question in
Q&A
Replies: 1 comment
-
Creating views of tensors (subtensor) is in development, see also https://github.com/boostorg/ublas/tree/features/subtensor. The UI might look something like this: // create tensor
auto A = ublas::tensor{3,4,2};
// create view
auto V = A ( {1,2}, {1,4}, {1,2} );
// iterate using std library
std::for_each(V.begin(), V.end(), lambda);
// or iterate using ublas library (faster than using std::for_each)
ublas::for_each(V.begin(3),V.end(3), lambda); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I can't find in the documentation how to create a "view" or "subtensor" over an existing tensor.
For example, if I interpret a rank 3 tensor as a "sequence" of 2D matrix-like rank 2 subtensors, I'd like to be able to iterate though each element in that sequence and pass it to a function expecting that rank 2 "subtensor".
How can I do that?
Beta Was this translation helpful? Give feedback.
All reactions