Weights
@Target(allowedTargets = [AnnotationTarget.PROPERTY, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD] )
Marks a tensor as an immutable weight that should be file-backed (memory-mapped) when possible.
Equivalent to @Place(device = CPU, memory = MMAP_FILE) with Residency.PERSISTENT. The planner treats these tensors as read-only and long-lived, preferring OS-paged file access over heap allocation.
Example:
@Weights
val embeddings: Tensor<FP32, Float>
@Weights(memory = MemoryDomain.HOST_HEAP) // force heap for small weights
val biasVector: Tensor<FP32, Float>Content copied to clipboard