Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
xgboost::ArrayInterface< D, allow_mask > Class Template Reference

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}
 

Detailed Description

template<int32_t D, bool allow_mask = (D == 1)>
class xgboost::ArrayInterface< D, allow_mask >

A type erased view over array_interface protocol defined by numpy.

numpy.

Template Parameters
DThe 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.

Template Parameters
allow_maskWhether 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.


The documentation for this class was generated from the following file: