PoolingOptions
Options & Configuration · AiDotNet.Memory
Configuration options for the tensor pool, which manages memory reuse during neural network operations. The tensor pool helps reduce memory allocations and garbage collection pressure by reusing tensor buffers.
How It Works
Tensor pooling is especially beneficial for:
- Inference operations with consistent input sizes
- Training loops where tensor shapes are predictable
- High-throughput scenarios where allocation overhead matters
Example usage:
Constructors
| Constructor | Summary |
|---|---|
PoolingOptions() |
Properties
| Property | Summary |
|---|---|
bool Enabled { get; set; } |
Gets or sets a value indicating whether tensor pooling is enabled. |
bool UseWeakReferences { get; set; } |
Gets or sets a value indicating whether to use weak references for pooled tensors. |
int MaxElementsToPool { get; set; } |
Gets or sets the maximum number of elements a single tensor can have to be eligible for pooling. |
int MaxItemsPerBucket { get; set; } |
Gets or sets the maximum number of tensors to keep in each shape bucket. |
int MaxPoolSizeMB { get; set; } |
Gets or sets the maximum memory size of the tensor pool in megabytes. |
long MaxPoolSizeBytes { get; set; } |
Gets or sets the maximum memory size of the tensor pool in bytes. |