Language: English
Last updated: 2026-04-11
This page: Getting started
Switch: Chinese
Language switch: Chinese
cd statgpu
pip install -e .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))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 / cpuSee also: