Class DenseLinearRelease

java.lang.Object
smile.llm.quant.DenseLinearRelease

public final class DenseLinearRelease extends Object
Releases placeholder dense LinearLayer shells after quantized ops are installed, so empty GPU weight storage does not inflate the KV budget.
  • Method Details

    • unregisterAndClose

      public static void unregisterAndClose(MemorySegment parentModule, String name, LinearOp op)
      Unregisters name from parentModule (if present) and closes the dense layer so LibTorch can free its parameter storage.
      Parameters:
      parentModule - parent PyTorch module handle, or null.
      name - registered submodule name, or null.
      op - linear op to close when it is a LinearLayer.