Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 956 Bytes

File metadata and controls

46 lines (34 loc) · 956 Bytes

Quickstart

Language: English
Last updated: 2026-04-11
This page: Getting started
Switch: Chinese

Language switch: Chinese

Installation

cd statgpu
pip install -e .

Minimal Example

import numpy as np
from statgpu.linear_model import LinearRegression

X = np.random.randn(1000, 20)
y = X @ np.random.randn(20) + 0.1 * np.random.randn(1000)

model = LinearRegression(device="cuda")
model.fit(X, y)
print(model.score(X, y))

Device Control

import statgpu as sg

sg.set_device("auto")
sg.set_device("cuda")
sg.set_device("cpu")
print(sg.get_device().value)  # resolved device, e.g. cuda / cpu

See also: