Skip to content

[QST] Get a slice of the Tensor while keeping the dimension #1802

@phantaurus

Description

@phantaurus

What is your question?
Hello!

Would there be easy ways to get a slice of the Tensor while keeping the dimension?

I have a tensor with shape (16, 4, 16)

When doing

for(int idx = 0; idx < size<1>(tensor); ++idx) {
    slice = tensor(_, idx, _)...
}

This generates slice with shape (16, 16).
Would it be possible to get (16, 1, 16) instead?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions