Skip to content

Conversation

@mrkn
Copy link
Member

@mrkn mrkn commented Jan 22, 2019

I would like to add some test cases for tensors with non-contiguous strides.

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

Thanks for adding this! Here are some comments.

Copy link
Member

Choose a reason for hiding this comment

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

Also ASSERT_FALSE(is_column_major()) and ASSERT_TRUE(is_contiguous())?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

Also ASSERT_FALSE on the row_major / column_major properties?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

Same here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

Ideally there would be a test helper which would allow writing:

AssertCOOIndex(sidx, {0}, {0, 0, 0});
AssertCOOIndex(sidx, {1}, {0, 0, 2});
// etc.

It would make the tests a bit clearer and shorter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting. Out of curiosity, why not row-major?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is for the zero-copy compatibility with SciPy and pydata/sparse.

See this discussion.

Copy link
Member

@pitrou pitrou Jan 23, 2019

Choose a reason for hiding this comment

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

This kind of code occurs several time in the test file. Could you define a test helper for this (perhaps in test-util.h)? So this would become e.g.:

AssertNumericDataEqual(st.raw_data(), std::vector<int64_t>{1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 16});

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

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 benefit from a AssertNumericDataEqual helper or similar.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@pitrou
Copy link
Member

pitrou commented Jan 28, 2019

Thanks for the updates @mrkn. There are some compilation and linting failures that need fixing (see the Travis-CI and AppVeyor builds).

@pitrou
Copy link
Member

pitrou commented Jan 28, 2019

I will merge if CI succeeds.

@pitrou pitrou force-pushed the add_strided_numeric_tensor_tests branch from 0ccadf4 to 5841794 Compare January 28, 2019 16:46
@pitrou
Copy link
Member

pitrou commented Jan 28, 2019

I pushed a fix for what I hope is the last Windows compilation error :-)

@pitrou
Copy link
Member

pitrou commented Jan 28, 2019

Successful AppVeyor build at: https://ci.appveyor.com/project/pitrou/arrow/builds/21945035

@pitrou pitrou closed this in 442ced0 Jan 28, 2019
@mrkn mrkn deleted the add_strided_numeric_tensor_tests branch January 28, 2019 20:07
@mrkn
Copy link
Member Author

mrkn commented Jan 28, 2019

Thank you very much!

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.

2 participants