|
xgboost
|
张量存储。要将其用于切片等其他功能,首先需要获取一个视图。这样我们就可以在主机和设备上使用它。 更多...
#include <linalg.h>

公共类型 | |
| 使用 | ShapeT = std::size_t[kDim] |
| 使用 | StrideT = ShapeT |
公共成员函数 | |
| Tensor ()=default | |
| template<typename I , int32_t D> | |
| Tensor (I const (&shape)[D], DeviceOrd device, Order order=kC) | |
| 使用形状和设备序号创建一个张量。存储空间会自动初始化。 更多... | |
| template<typename I , size_t D> | |
| Tensor (common::Span< I const, D > shape, DeviceOrd device, Order order=kC) | |
| template<typename It , typename I , int32_t D> | |
| Tensor (It begin, It end, I const (&shape)[D], DeviceOrd device, Order order=kC) | |
| template<typename I , int32_t D> | |
| Tensor (std::initializer_list< T > data, I const (&shape)[D], DeviceOrd device, Order order=kC) | |
| template<typename... Index> | |
| T & | operator() (Index &&...idx) |
| 索引操作符。非线程安全,不应在性能关键区域使用。为了更高效的索引,请首先考虑获取视图。 更多... | |
| template<typename... Index> | |
| T const & | operator() (Index &&...idx) const |
| 索引操作符。非线程安全,不应在性能关键区域使用。为了更高效的索引,请首先考虑获取视图。 更多... | |
| auto | View (DeviceOrd device) |
| 获取此张量的 TensorView。 更多... | |
| auto | View (DeviceOrd device) const |
| auto | HostView () |
| auto | HostView () const |
| std::size_t | Size () const |
| bool | Empty () const |
| auto | Shape () const |
| auto | Shape (size_t i) const |
| HostDeviceVector< T > * | 数据 () |
| HostDeviceVector< T > const * | Data () const |
| template<typename Fn > | |
| void | ModifyInplace (Fn &&fn) |
| 用于改变形状和数据的修改的访问者函数。 更多... | |
| template<typename... S, detail::EnableIfIntegral< S... > * = nullptr> | |
| void | Reshape (S &&...s) |
| 重塑张量。 更多... | |
| template<size_t D> | |
| void | Reshape (common::Span< size_t const, D > shape) |
| 重塑张量。 更多... | |
| template<size_t D> | |
| void | Reshape (size_t(&shape)[D]) |
| template<typename... S> | |
| auto | Slice (S &&...slices) const |
| 获取切片的主机视图。 更多... | |
| template<typename... S> | |
| auto | Slice (S &&...slices) |
| 获取切片的主机视图。 更多... | |
| void | SetDevice (DeviceOrd device) const |
| 设置此张量的设备序号。 更多... | |
| DeviceOrd | Device () const |
张量存储。要将其用于切片等其他功能,需要首先获取一个视图。这样我们就可以在主机和设备上使用它。
| 使用 xgboost::linalg::Tensor< T, kDim >::ShapeT = std::size_t[kDim] |
| 使用 xgboost::linalg::Tensor< T, kDim >::StrideT = ShapeT |
|
默认 |
|
内联显式 |
使用形状和设备序号创建一个张量。存储空间会自动初始化。
参见 TensorView 了解此构造函数的参数。
|
内联显式 |
|
内联显式 |
从两个主机迭代器初始化。
|
内联显式 |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
用于改变形状和数据的修改的访问者函数。
| Fn | 一个函数,它接受指向 HostDeviceVector 的指针和一个静态大小的 span 作为参数。 |
|
inline |
索引操作符。非线程安全,不应在性能关键区域使用。为了更高效的索引,请首先考虑获取视图。
|
inline |
索引操作符。非线程安全,不应在性能关键区域使用。为了更高效的索引,请首先考虑获取视图。
|
inline |
重塑张量。
如果总大小发生变化,则此张量中的数据不再有效。
|
inline |
重塑张量。
如果总大小发生变化,则此张量中的数据不再有效。
|
inline |
|
inline |
设置此张量的设备序号。
|
inline |
|
inline |
|
inline |
|
inline |
获取切片的主机视图。
|
inline |
获取切片的主机视图。
|
inline |
获取此张量的 TensorView。
|
inline |