|
ACTS
Experiment-independent tracking
|
This is a very small, limited class that models a 2D tensor of arbitrary type. More...
#include <ActsPlugins/Gnn/Tensor.hpp>
Public Types | |
| using | Shape = std::array<std::size_t, 2> |
| Type alias for tensor shape as 2D dimensions array. | |
Public Member Functions | |
| Tensor | clone (const ExecutionContext &to) const |
| Clone the tensor, copying the data to the new device. | |
| T * | data () |
| Get the non-const data pointer. | |
| const T * | data () const |
| Get the const data pointer. | |
| Device | device () const |
| Get the device of the tensor. | |
| std::size_t | nbytes () const |
| Get the number of bytes of the tensor. | |
| Shape | shape () const |
| Get the shape of the tensor. | |
| std::size_t | size () const |
| Get the number of elements in the tensor. | |
Static Public Member Functions | |
| static Tensor | Create (Shape shape, const ExecutionContext &execContext) |
| Create a new tensor with specified shape and execution context. | |
This is a very small, limited class that models a 2D tensor of arbitrary type.
It is move-only, and only possible to create via static factory functions to ensure lifetime management. This on purpose does not implement operations such as clone/to-host/to-cuda
| using ActsPlugins::Tensor< T >::Shape = std::array<std::size_t, 2> |
Type alias for tensor shape as 2D dimensions array.
| Tensor ActsPlugins::Tensor< T >::clone | ( | const ExecutionContext & | to | ) | const |
Clone the tensor, copying the data to the new device.
| to | The {device, stream} to clone to |
|
static |
Create a new tensor with specified shape and execution context.
| shape | 2D tensor dimensions [rows, columns] |
| execContext | Execution context specifying device and optional CUDA stream |
| T * ActsPlugins::Tensor< T >::data | ( | ) |
Get the non-const data pointer.
| const T * ActsPlugins::Tensor< T >::data | ( | ) | const |
Get the const data pointer.
| Device ActsPlugins::Tensor< T >::device | ( | ) | const |
Get the device of the tensor.
| std::size_t ActsPlugins::Tensor< T >::nbytes | ( | ) | const |
Get the number of bytes of the tensor.
| Shape ActsPlugins::Tensor< T >::shape | ( | ) | const |
Get the shape of the tensor.
| std::size_t ActsPlugins::Tensor< T >::size | ( | ) | const |
Get the number of elements in the tensor.