Skip to content

Conversation

@gouarin
Copy link
Member

@gouarin gouarin commented Mar 4, 2022

No description provided.

@tdegeus
Copy link
Member

tdegeus commented Mar 4, 2022

Awesome! LGTM

Copy link
Member

@JohanMabille JohanMabille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! With a slight change to simplify the code it will be perfect ;)

static bool run(const B& buf)
{
auto shape = FSH();
for (std::size_t i = 0; i < shape.size(); ++i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be simplified with std::equal

Copy link
Member Author

@gouarin gouarin Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented the first version with std::equal. The problem is that buf.shape()is not an iterator.

Copy link
Member

@JohanMabille JohanMabille Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you can use &(buf.shape(0)) and we should definitely open an issue on the pybind11 repo so that they provide an iterator API for the shape.

@JohanMabille JohanMabille merged commit 9cf4028 into xtensor-stack:master Mar 4, 2022
@gouarin gouarin deleted the add-xtensor-fixed branch March 4, 2022 17:40
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 this pull request may close these issues.

3 participants