MemoryAwareTensorViewStrategy

Memory-pressure-aware tensor view strategy.

This strategy extends the default strategy with basic memory pressure detection. When memory pressure is high, it more aggressively prefers copying over views to allow garbage collection of parent tensors.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Threshold for available memory percentage. If available memory falls below this percentage, the strategy becomes more aggressive about copying.

Link copied to clipboard

Adjusted view size threshold under memory pressure.

Functions

Link copied to clipboard
open override fun getDecisionReason(tensor: Tensor<T, V>, slices: List<Slice<T, V>>): String

Provides a reason code for the view vs copy decision.

Link copied to clipboard
open override fun shouldCreateView(tensor: Tensor<T, V>, slices: List<Slice<T, V>>): Boolean

Determines whether a view should be created for the given slices.