array_t#
Fully qualified name: wp::array_t
-
template<typename T>
struct array_t# Binary-compatible view of a Python
wp.arrayof element typeT.Layout matches
wp::array_t<T>in the native Warp runtime:T* data,T* grad, :class:shape_tshape,int strides[4],int ndim. Strides are byte strides.gradis null when the array has no gradient.Public Functions
-
inline array_t()#
-
inline array_t(T *data, int size, T *grad = nullptr)#
Constructs a one-dimensional array view over an existing buffer.
- Parameters:
data – [in] Pointer to the first element of the buffer.
size – [in] Number of elements in the buffer.
grad – [in] Optional pointer to the gradient buffer, or nullptr if none.
-
inline bool empty() const#
Returns whether the array has no backing data.
- Returns:
True if the data pointer is null; false otherwise.
Public Members
-
int strides[ARRAY_MAX_DIMS]#
Per-dimension byte strides between consecutive elements.
-
int ndim#
Number of valid dimensions in the array.
-
inline array_t()#