Medial Code Documentation
|
A type erased view over array_interface protocol defined by numpy. More...
#include <array_interface.h>
Public Member Functions | |
ArrayInterface (Object::Map const &array) | |
ArrayInterface (Json const &array) | |
ArrayInterface (std::string const &str) | |
ArrayInterface (StringView str) | |
void | AssignType (StringView typestr) |
XGBOOST_DEVICE std::size_t | Shape (size_t i) const |
XGBOOST_DEVICE std::size_t | Stride (size_t i) const |
template<typename Fn > | |
XGBOOST_HOST_DEV_INLINE decltype(auto) | DispatchCall (Fn func) const |
XGBOOST_DEVICE std::size_t | ElementSize () const |
XGBOOST_DEVICE std::size_t | ElementAlignment () const |
template<typename T = float, typename... Index> | |
XGBOOST_HOST_DEV_INLINE T | operator() (Index &&...index) const |
Data Fields | |
RBitField8 | valid |
std::size_t | strides [D] {0} |
std::size_t | shape [D] {0} |
void const * | data {nullptr} |
std::size_t | n {0} |
bool | is_contiguous {false} |
ArrayInterfaceHandler::Type | type {ArrayInterfaceHandler::kF16} |
A type erased view over array_interface protocol defined by numpy.
D | The number of maximum dimension. |
User input array must have dim <= D for all non-trivial dimensions. During construction, the ctor can automatically remove those trivial dimensions.
allow_mask | Whether masked array is accepted. |
Currently this only supported for 1-dim vector, which is used by cuDF column (apache arrow format). For general masked array, as the time of writting, only numpy has the proper support even though it's in the cuda_array_interface protocol defined by numba.