* @return reference to the element at position idx
*/
inline reference operator[](size_t idx) noexcept {
- assert(idx >= 0 && idx < _size);
+ assert(idx < _size);
return _storage[idx];
}
*/
inline constexpr value_type operator[](size_t idx) const noexcept {
//assert on the same line since c++11 does not allow multi-line constexpr functions
- return assert(idx >= 0 && idx < _size), _storage[idx];
+ return assert(idx < _size), _storage[idx];
}
inline iterator begin() noexcept {
const int32_t rank = shape.rank();
hsize_t dims[rank];
for (int32_t axis = 0; axis < rank; ++axis) {
- dims[axis] = shape.dim(axis);
+ dims[axis] = static_cast<hsize_t>(shape.dim(axis));
}
// Create float array from tensor