gpuLoadTensor (Function)
Signature: gpuLoadTensor(path: string, name: string) -> Result<GpuBuffer<float>, Error>
Description: Reads one named tensor out of a safetensors file into a GpuBuffer
Parameters
- path (string): The safetensors file
- name (string): The tensor's name in the header
Returns: Result<GpuBuffer
Example
gpuLoadTensor("model.safetensors", "wte.weight") ?: toGpu([0.0])
gpuLoadTensor ("model.safetensors", "wte.weight") ?: toGpu [0.0]