Represents a pool of tensors to manage GPU resources. The pool is responsible for managing the lifetime of the tensors and freeing them when the pool is destroyed. More...
#include <gpu.h>
Public Member Functions | |
TensorPool (Context *ctx) | |
~TensorPool () | |
Destructor for TensorPool which frees all tensors in the pool. | |
Public Attributes | |
Context * | ctx |
std::unordered_map< WGPUBuffer, Tensor > | data |
Represents a pool of tensors to manage GPU resources. The pool is responsible for managing the lifetime of the tensors and freeing them when the pool is destroyed.
Most users do not need to interact with the TensorPool type, as there is a member instance in the Context struct to simplify lifetime management of GPU resources.
|
inline |
Destructor for TensorPool which frees all tensors in the pool.
Definition at line 624 of file gpu.h.