TensorViewStrategy
Strategy interface for deciding between view creation and tensor copying.
This interface provides the foundation for implementing fallback mechanisms when tensor views are not suitable or efficient for particular slicing operations. The strategy helps balance memory efficiency with performance considerations.
Use Cases
Complex Non-Contiguous Slices: When slice patterns result in very inefficient memory access patterns
Memory Pressure: When system memory is under pressure and views might prevent garbage collection of large parent tensors
Backend Limitations: When the underlying compute backend doesn't support efficient view operations
Parameters
T
the data type constraint extending DType
V
the actual value type