Skip to content

Commit

Permalink
Add ndarray::detail::ndarray_config default constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Sep 20, 2024
1 parent ee23846 commit e4de81a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions include/nanobind/ndarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,14 @@ struct unused {

/// ndarray_config describes a requested array configuration
struct ndarray_config {
int device_type;
char order;
bool ro;
dlpack::dtype dtype;
int32_t ndim;
int64_t *shape;
int device_type = 0;
char order = '\0';
bool ro = false;
dlpack::dtype dtype { };
int32_t ndim = -1;
int64_t *shape = nullptr;

ndarray_config() = default;
template <typename T> ndarray_config(T)
: device_type(T::DeviceType::value),
order((char) T::Order::value),
Expand Down

0 comments on commit e4de81a

Please sign in to comment.