|
xgboost
|
命名空间 | |
| 详细信息 | |
类 | |
| 类 | TensorView |
| 具有静态类型和维度的张量视图。它实现了索引和切片。 更多... | |
| 类 | 张量 (Tensor) |
| 张量存储。要将其用于切片等其他功能,首先需要获取一个视图。这样我们就可以在主机和设备上使用它。 更多... | |
类型定义 | |
| template<typename T > | |
| 使用 | VectorView = TensorView< T, 1 > |
| 向量视图,是 Tensor 的特化。更多... | |
| template<typename T > | |
| 使用 | MatrixView = TensorView< T, 2 > |
| 矩阵视图,是 Tensor 的特化。更多... | |
| template<typename T > | |
| 使用 | Matrix = Tensor< T, 2 > |
| template<typename T > | |
| 使用 | Vector = Tensor< T, 1 > |
枚举 | |
| 枚举 | Order : std::uint8_t { kC , kF } |
函数 | |
| constexpr detail::AllTag | 所有 () |
| 指定切片轴中的所有元素。更多... | |
| template<typename I > | |
| constexpr detail::RangeTag< I > | Range (I beg, I end) |
| 指定切片轴中的元素范围。更多... | |
| template<typename Container , typename... S, std::enable_if_t<!common::detail::IsSpan< Container >::value &&!std::is_pointer_v< Container >> * = nullptr> | |
| auto | MakeTensorView (Context const *ctx, Container &data, S &&...shape) |
| 用于自动类型推断的构造函数。更多... | |
| template<typename T , decltype(common::dynamic_extent) ext, typename... S> | |
| LINALG_HD auto | MakeTensorView (DeviceOrd device, common::Span< T, ext > data, S &&...shape) |
| template<typename T , decltype(common::dynamic_extent) ext, typename... S> | |
| auto | MakeTensorView (Context const *ctx, common::Span< T, ext > data, S &&...shape) |
| template<typename T , decltype(common::dynamic_extent) ext, typename... S> | |
| auto | MakeTensorView (Context const *ctx, Order order, common::Span< T, ext > data, S &&...shape) |
| template<typename T , typename... S> | |
| auto | MakeTensorView (Context const *ctx, HostDeviceVector< T > *data, S &&...shape) |
| template<typename T , typename... S> | |
| auto | MakeTensorView (Context const *ctx, HostDeviceVector< T > const *data, S &&...shape) |
| template<size_t D> | |
| LINALG_HD auto | UnravelIndex (size_t idx, common::Span< size_t const, D > shape) |
| 将线性索引转换为多维索引。类似于 numpy 的 unravel。更多... | |
| template<size_t D> | |
| LINALG_HD auto | UnravelIndex (size_t idx, std::size_t const (&shape)[D]) |
| template<typename... S> | |
| LINALG_HD auto | UnravelIndex (std::size_t idx, S... shape) |
| template<typename T > | |
| auto | MakeVec (T *ptr, size_t s, DeviceOrd device=DeviceOrd::CPU()) |
| 从连续内存创建向量视图。更多... | |
| template<typename T > | |
| auto | MakeVec (HostDeviceVector< T > *data) |
| template<typename T > | |
| auto | MakeVec (HostDeviceVector< T > const *data) |
| template<typename T , std::int32_t D> | |
| Json | ArrayInterface (TensorView< T const, D > const &t) |
| 由 numpy 定义的数组接口。更多... | |
| template<typename T , int32_t D> | |
| Json | ArrayInterface (TensorView< T, D > const &t) |
| 与 const 版本相同,但返回非只读数据指针。更多... | |
| template<typename T , int32_t D> | |
| auto | ArrayInterfaceStr (TensorView< T const, D > const &t) |
| 返回数组接口的字符串表示。更多... | |
| template<typename T , int32_t D> | |
| auto | ArrayInterfaceStr (TensorView< T, D > const &t) |
| template<typename T > | |
| auto | Make1dInterface (T const *vec, std::size_t len) |
| template<typename T , typename... Index> | |
| auto | Empty (Context const *ctx, Index &&...index) |
| 创建未初始化的数组。更多... | |
| template<typename T , typename... Index> | |
| auto | Constant (Context const *ctx, T v, Index &&...index) |
| 创建值为 v 的数组。更多... | |
| template<typename T , typename... Index> | |
| auto | Zeros (Context const *ctx, Index &&...index) |
类似于 np.zeros,返回一个给定形状和类型的新数组,填充为零。更多... | |
| template<typename T , int32_t D> | |
| void | Stack (Tensor< T, D > *l, Tensor< T, D > const &r) |
| using xgboost::linalg::Matrix = typedef Tensor<T, 2> |
| using xgboost::linalg::MatrixView = typedef TensorView<T, 2> |
矩阵视图,是 Tensor 的特化。
| T | 矩阵的数据类型 |
| using xgboost::linalg::Vector = typedef Tensor<T, 1> |
| using xgboost::linalg::VectorView = typedef TensorView<T, 1> |
向量视图,是 Tensor 的特化。
| T | 向量的数据类型 |
| enum xgboost::linalg::Order : std::uint8_t |
|
constexpr |
指定切片轴中的所有元素。
| Json xgboost::linalg::ArrayInterface | ( | TensorView< T const, D > const & | t | ) |
由 numpy 定义的数组接口。
当数据在 CUDA 设备上时,可选择包含 stream。
| Json xgboost::linalg::ArrayInterface | ( | TensorView< T, D > const & | t | ) |
与 const 版本相同,但返回非只读数据指针。
| auto xgboost::linalg::ArrayInterfaceStr | ( | TensorView< T const, D > const & | t | ) |
返回数组接口的字符串表示。
| auto xgboost::linalg::ArrayInterfaceStr | ( | TensorView< T, D > const & | t | ) |
| auto xgboost::linalg::Constant | ( | Context const * | ctx, |
| T | v, | ||
| Index &&... | index | ||
| ) |
创建值为 v 的数组。
| auto xgboost::linalg::Empty | ( | Context const * | ctx, |
| Index &&... | index | ||
| ) |
创建未初始化的数组。
| auto xgboost::linalg::Make1dInterface | ( | T const * | 向量, |
| std::size_t | 长度 | ||
| ) |
| auto xgboost::linalg::MakeTensorView | ( | Context const * | ctx, |
| common::Span< T, ext > | 数据, | ||
| S &&... | shape | ||
| ) |
| auto xgboost::linalg::MakeTensorView | ( | Context const * | ctx, |
| Container & | 数据, | ||
| S &&... | shape | ||
| ) |
用于自动类型推断的构造函数。
| auto xgboost::linalg::MakeTensorView | ( | Context const * | ctx, |
| HostDeviceVector< T > * | 数据, | ||
| S &&... | shape | ||
| ) |
| auto xgboost::linalg::MakeTensorView | ( | Context const * | ctx, |
| HostDeviceVector< T > const * | 数据, | ||
| S &&... | shape | ||
| ) |
| auto xgboost::linalg::MakeTensorView | ( | Context const * | ctx, |
| Order | 顺序, | ||
| common::Span< T, ext > | 数据, | ||
| S &&... | shape | ||
| ) |
| LINALG_HD auto xgboost::linalg::MakeTensorView | ( | DeviceOrd | device, |
| common::Span< T, ext > | 数据, | ||
| S &&... | shape | ||
| ) |
| auto xgboost::linalg::MakeVec | ( | HostDeviceVector< T > * | 数据 | ) |
| auto xgboost::linalg::MakeVec | ( | HostDeviceVector< T > const * | 数据 | ) |
| auto xgboost::linalg::MakeVec | ( | T * | ptr, |
| size_t | s, | ||
| DeviceOrd | 设备 = DeviceOrd::CPU() |
||
| ) |
从连续内存创建向量视图。
| ptr | 指向连续内存的指针。 |
| s | 向量的大小。 |
| device | (可选) 设备序号,默认为主机。 |
|
constexpr |
指定切片轴中的元素范围。
| void xgboost::linalg::Stack | ( | Tensor< T, D > * | l, |
| Tensor< T, D > const & | r | ||
| ) |
| LINALG_HD auto xgboost::linalg::UnravelIndex | ( | size_t | idx, |
| common::Span< size_t const, D > | shape | ||
| ) |
将线性索引转换为多维索引。类似于 numpy 的 unravel。
| LINALG_HD auto xgboost::linalg::UnravelIndex | ( | size_t | idx, |
| std::size_t const (&) | 形状[D] | ||
| ) |
| LINALG_HD auto xgboost::linalg::UnravelIndex | ( | std::size_t | idx, |
| S... | shape | ||
| ) |
| auto xgboost::linalg::Zeros | ( | Context const * | ctx, |
| Index &&... | index | ||
| ) |
类似于 np.zeros,返回一个给定形状和类型的新数组,填充为零。