-
Notifications
You must be signed in to change notification settings - Fork 17
Optional extent checking on array dimensions #112
Copy link
Copy link
Open
Description
Thank you for developing an awesome library! It would be useful to be able to toggle extent checking at runtime for testing. We have encountered a couple of rare problems with indices going past their extents but still mapping to a valid flat offset, such as a 2 x 3 x 4 tensor with index (3, 1, 1) in column major ordering that returns a flat offset of
3 + 1 * (2) + 1 * (2 * 3) = 11 (less than 2 * 3 * 4 = 24 so valid)
seems like it would be fairly easy to just add something like this below line 481
#ifdef NDA_BOUND_CHECKING
if (at - min_ >= extent_) {
throw std::runtime_error(...)
}
#endifto catch these greater than extent errors. Do you think this is reasonable?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels