A tensor storage. To use it for other functionality like slicing one needs to obtain a view first. This way we can use it on both host and device.
More...
|
| Tensor ()=default |
|
template<typename I , int32_t D> |
| Tensor (I const (&shape)[D], std::int32_t device, Order order=kC) |
| Create a tensor with shape and device ordinal. The storage is initialized automatically. More...
|
|
template<typename I , size_t D> |
| Tensor (common::Span< I const, D > shape, std::int32_t device, Order order=kC) |
|
template<typename It , typename I , int32_t D> |
| Tensor (It begin, It end, I const (&shape)[D], std::int32_t device, Order order=kC) |
|
template<typename I , int32_t D> |
| Tensor (std::initializer_list< T > data, I const (&shape)[D], std::int32_t device, Order order=kC) |
|
template<typename... Index> |
T & | operator() (Index &&...idx) |
| Index operator. Not thread safe, should not be used in performance critical region. For more efficient indexing, consider getting a view first. More...
|
|
template<typename... Index> |
T const & | operator() (Index &&...idx) const |
| Index operator. Not thread safe, should not be used in performance critical region. For more efficient indexing, consider getting a view first. More...
|
|
TensorView< T, kDim > | View (int32_t device) |
| Get a TensorView for this tensor. More...
|
|
TensorView< T const, kDim > | View (int32_t device) const |
|
auto | HostView () const |
|
auto | HostView () |
|
size_t | Size () const |
|
auto | Shape () const |
|
auto | Shape (size_t i) const |
|
HostDeviceVector< T > * | Data () |
|
HostDeviceVector< T > const * | Data () const |
|
template<typename Fn > |
void | ModifyInplace (Fn &&fn) |
| Visitor function for modification that changes shape and data. More...
|
|
template<typename... S, detail::EnableIfIntegral< S... > * = nullptr> |
void | Reshape (S &&...s) |
| Reshape the tensor. More...
|
|
template<size_t D> |
void | Reshape (common::Span< size_t const, D > shape) |
| Reshape the tensor. More...
|
|
template<size_t D> |
void | Reshape (size_t(&shape)[D]) |
|
template<typename... S> |
auto | Slice (S &&...slices) const |
| Get a host view on the slice. More...
|
|
template<typename... S> |
auto | Slice (S &&...slices) |
| Get a host view on the slice. More...
|
|
void | SetDevice (int32_t device) const |
| Set device ordinal for this tensor. More...
|
|
int32_t | DeviceIdx () const |
|
template<typename T, int32_t kDim = 5>
class xgboost::linalg::Tensor< T, kDim >
A tensor storage. To use it for other functionality like slicing one needs to obtain a view first. This way we can use it on both host and device.