tensorstudio 0.1.0__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/.github/workflows/wheels.yml +9 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/CHANGELOG.md +7 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/CMakeLists.txt +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/PKG-INFO +2 -2
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/README.md +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/SECURITY.md +2 -2
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/Autograde/index.md +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/Benchmarks/index.md +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/Hardware/cpu-backend.md +3 -3
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/Neural Networks/modules.md +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/Neural Networks/training.md +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/Roadmap/index.md +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/Usage/serialization.md +2 -2
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/Usage/tensors.md +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/api.md +10 -27
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/development.md +8 -11
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/index.md +3 -3
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/publishing.md +2 -2
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/version.hpp +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/pyproject.toml +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/_version.py +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/serialization.py +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/bindings/bind_tensor.cpp +4 -4
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/serialization.cpp +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/tests/test_import.py +1 -1
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/.github/workflows/ci.yml +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/.github/workflows/publish.yml +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/.gitignore +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/.pre-commit-config.yaml +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/CONTRIBUTING.md +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/LICENSE +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/benchmarks/bench_matmul.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/benchmarks/bench_tensor_ops.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/Usage/numpy-interop.md +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/docs/quickstart.md +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/examples/basic_tensor_ops.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/examples/linear_regression.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/examples/save_load_model.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/examples/tiny_mlp.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/autograd.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/device.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/dtype.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/errors.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/module.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/ops.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/optim.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/random.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/serialization.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/shape.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/storage.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/include/tensorstudio/tensor.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/mkdocs.yml +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/_C.pyi +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/__init__.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/autograd.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/data/__init__.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/data/dataloader.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/data/dataset.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/errors.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/nn/__init__.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/nn/functional.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/nn/losses.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/nn/modules.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/ops.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/optim/__init__.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/optim/adam.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/optim/sgd.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/py.typed +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/tensor.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/python/tensorstudio/typing.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/bindings/bind_autograd.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/bindings/bind_nn.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/bindings/bind_ops.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/bindings/bind_optim.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/bindings/bindings.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/bindings/bindings.hpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/autograd.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/device.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/dtype.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/errors.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/module.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/ops.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/optim.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/random.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/shape.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/storage.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/src/core/tensor.cpp +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/tests/test_autograd.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/tests/test_nn.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/tests/test_numpy_interop.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/tests/test_ops.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/tests/test_optim.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/tests/test_serialization.py +0 -0
- {tensorstudio-0.1.0 → tensorstudio-0.1.1}/tests/test_tensor.py +0 -0
|
@@ -10,6 +10,8 @@ jobs:
|
|
|
10
10
|
build_wheels:
|
|
11
11
|
name: Build wheels on ${{ matrix.os }}
|
|
12
12
|
runs-on: ${{ matrix.os }}
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
13
15
|
strategy:
|
|
14
16
|
fail-fast: false
|
|
15
17
|
matrix:
|
|
@@ -22,6 +24,13 @@ jobs:
|
|
|
22
24
|
python-version: "3.12"
|
|
23
25
|
- name: Build wheels
|
|
24
26
|
uses: pypa/cibuildwheel@v2.23.3
|
|
27
|
+
env:
|
|
28
|
+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
|
|
29
|
+
CIBW_SKIP: "*-musllinux*"
|
|
30
|
+
CIBW_ARCHS_WINDOWS: "AMD64"
|
|
31
|
+
CIBW_ARCHS_LINUX: "x86_64"
|
|
32
|
+
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
|
|
33
|
+
CIBW_TEST_COMMAND: "python -c \"import tensorstudio as ts; x = ts.tensor([1.0, 2.0], requires_grad=True); y = (x * x).sum(); y.backward(); print(ts.__version__, x.grad.tolist())\""
|
|
25
34
|
- uses: actions/upload-artifact@v4
|
|
26
35
|
with:
|
|
27
36
|
name: wheels-${{ matrix.os }}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
- Publishable wheel release for CPython 3.10-3.13.
|
|
6
|
+
- Fixed MSVC build portability by removing non-portable `ssize_t` usage.
|
|
7
|
+
- Updated wheel CI to build 64-bit Windows wheels and modern Linux wheels.
|
|
8
|
+
- Expanded documentation with MkDocs navigation and detailed usage guides.
|
|
9
|
+
|
|
3
10
|
## 0.1.0
|
|
4
11
|
|
|
5
12
|
- Initial experimental release.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: tensorstudio
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: TensorStudio is a compact C++ tensor and autograd engine with a Python API for learning, experimentation, and lightweight ML workloads.
|
|
5
5
|
Keywords: tensor,autograd,machine-learning,cpp,pybind11
|
|
6
6
|
Author: TensorStudio contributors
|
|
@@ -65,7 +65,7 @@ Description-Content-Type: text/markdown
|
|
|
65
65
|
TensorStudio is a compact C++ tensor and autograd engine with a Python API for
|
|
66
66
|
learning, experimentation, and lightweight ML workloads.
|
|
67
67
|
|
|
68
|
-
TensorStudio is experimental v0.1.
|
|
68
|
+
TensorStudio is experimental v0.1.1 software. It is CPU-only, eager-only, and
|
|
69
69
|
intentionally small enough to read and modify.
|
|
70
70
|
|
|
71
71
|
## Install
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
TensorStudio is a compact C++ tensor and autograd engine with a Python API for
|
|
8
8
|
learning, experimentation, and lightweight ML workloads.
|
|
9
9
|
|
|
10
|
-
TensorStudio is experimental v0.1.
|
|
10
|
+
TensorStudio is experimental v0.1.1 software. It is CPU-only, eager-only, and
|
|
11
11
|
intentionally small enough to read and modify.
|
|
12
12
|
|
|
13
13
|
## Install
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Security Policy
|
|
2
2
|
|
|
3
|
-
TensorStudio is experimental v0.1.
|
|
3
|
+
TensorStudio is experimental v0.1.x software.
|
|
4
4
|
|
|
5
5
|
## Reporting a Vulnerability
|
|
6
6
|
|
|
@@ -16,6 +16,6 @@ Include:
|
|
|
16
16
|
|
|
17
17
|
## Serialization Warning
|
|
18
18
|
|
|
19
|
-
`tensorstudio.load()` uses Python pickle for v0.1.
|
|
19
|
+
`tensorstudio.load()` uses Python pickle for v0.1.x internal object roundtrips.
|
|
20
20
|
Loading pickle files from untrusted sources is unsafe because pickle can execute
|
|
21
21
|
arbitrary code during deserialization.
|
|
@@ -33,7 +33,7 @@ multiplication on the same shapes.
|
|
|
33
33
|
## Interpreting Results
|
|
34
34
|
|
|
35
35
|
Expect NumPy to be faster for many operations because it uses highly optimized
|
|
36
|
-
native kernels. TensorStudio v0.1.
|
|
36
|
+
native kernels. TensorStudio v0.1.x favors clarity and correctness over kernel
|
|
37
37
|
performance.
|
|
38
38
|
|
|
39
39
|
Useful benchmark notes:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# CPU Backend
|
|
2
2
|
|
|
3
|
-
TensorStudio v0.1.
|
|
3
|
+
TensorStudio v0.1.x supports CPU tensors only.
|
|
4
4
|
|
|
5
5
|
## Device Abstraction
|
|
6
6
|
|
|
7
7
|
The C++ core includes a device abstraction so future backends can fit into the
|
|
8
8
|
same public model. Today, every tensor lives on CPU.
|
|
9
9
|
|
|
10
|
-
## What CPU Means In v0.1.
|
|
10
|
+
## What CPU Means In v0.1.x
|
|
11
11
|
|
|
12
12
|
- Storage is host memory.
|
|
13
13
|
- Operations run synchronously.
|
|
@@ -36,4 +36,4 @@ CUDA and other accelerator backends are future work. Adding them would require:
|
|
|
36
36
|
- kernel implementations
|
|
37
37
|
- expanded testing infrastructure
|
|
38
38
|
|
|
39
|
-
The current CPU implementation keeps those concerns out of v0.1.
|
|
39
|
+
The current CPU implementation keeps those concerns out of v0.1.x.
|
|
@@ -97,6 +97,6 @@ model.train()
|
|
|
97
97
|
model.eval()
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
These currently toggle the `training` flag recursively. v0.1.
|
|
100
|
+
These currently toggle the `training` flag recursively. v0.1.x modules do not
|
|
101
101
|
include dropout or batch normalization, so the flag is mostly scaffolding for
|
|
102
102
|
future modules.
|
|
@@ -58,7 +58,7 @@ w = ts.randn((4, 4), seed=123)
|
|
|
58
58
|
|
|
59
59
|
## Practical Tips
|
|
60
60
|
|
|
61
|
-
- Keep tensors small in v0.1.
|
|
61
|
+
- Keep tensors small in v0.1.x; kernels are simple CPU loops.
|
|
62
62
|
- Prefer `float32` unless you need `float64`.
|
|
63
63
|
- Compare with NumPy in tests for expected numerical values.
|
|
64
64
|
- Watch shape errors carefully around broadcasting and matrix multiplication.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Serialization
|
|
2
2
|
|
|
3
|
-
TensorStudio v0.1.
|
|
3
|
+
TensorStudio v0.1.x provides simple Python-level serialization:
|
|
4
4
|
|
|
5
5
|
```python
|
|
6
6
|
import tensorstudio as ts
|
|
@@ -34,7 +34,7 @@ loaded = ts.load("model.tsmodel")
|
|
|
34
34
|
|
|
35
35
|
## Version Compatibility
|
|
36
36
|
|
|
37
|
-
The v0.1.
|
|
37
|
+
The v0.1.x format is not guaranteed to be stable across future releases. For
|
|
38
38
|
long-term model exchange, ONNX import/export is planned as future work.
|
|
39
39
|
|
|
40
40
|
## Recommended File Extension
|
|
@@ -32,20 +32,12 @@ Exports:
|
|
|
32
32
|
Creates a tensor from Python numeric scalars, nested sequences, another
|
|
33
33
|
TensorStudio tensor, or a NumPy array.
|
|
34
34
|
|
|
35
|
-
```python
|
|
36
|
-
x = ts.tensor([[1, 2], [3, 4]], dtype="float32")
|
|
37
|
-
```
|
|
38
|
-
|
|
39
35
|
Nested lists must be rectangular. Ragged lists raise a shape error.
|
|
40
36
|
|
|
41
37
|
### `from_numpy(array, requires_grad=False)`
|
|
42
38
|
|
|
43
39
|
Creates a TensorStudio tensor copy from a NumPy array.
|
|
44
40
|
|
|
45
|
-
```python
|
|
46
|
-
x = ts.from_numpy(np.array([1, 2, 3], dtype=np.int64))
|
|
47
|
-
```
|
|
48
|
-
|
|
49
41
|
### Fill And Range Helpers
|
|
50
42
|
|
|
51
43
|
```python
|
|
@@ -68,30 +60,25 @@ ts.arange(0, 10, 2)
|
|
|
68
60
|
|
|
69
61
|
## Tensor Methods
|
|
70
62
|
|
|
71
|
-
|
|
63
|
+
Conversion:
|
|
72
64
|
|
|
73
|
-
- `numpy()
|
|
74
|
-
- `tolist()
|
|
75
|
-
- `item()
|
|
65
|
+
- `numpy()`
|
|
66
|
+
- `tolist()`
|
|
67
|
+
- `item()`
|
|
76
68
|
|
|
77
|
-
|
|
69
|
+
Views:
|
|
78
70
|
|
|
79
71
|
- `reshape(*shape)` or `reshape(shape)`
|
|
80
72
|
- `flatten()`
|
|
81
73
|
- `transpose()`
|
|
82
74
|
- `T`
|
|
83
75
|
|
|
84
|
-
|
|
85
|
-
transpose.
|
|
86
|
-
|
|
87
|
-
### Reductions
|
|
76
|
+
Reductions:
|
|
88
77
|
|
|
89
78
|
- `sum()`
|
|
90
79
|
- `mean()`
|
|
91
80
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
### Activations And Math
|
|
81
|
+
Activations and math:
|
|
95
82
|
|
|
96
83
|
- `relu()`
|
|
97
84
|
- `sigmoid()`
|
|
@@ -99,13 +86,11 @@ Reductions currently reduce all elements to a scalar.
|
|
|
99
86
|
- `exp()`
|
|
100
87
|
- `log()`
|
|
101
88
|
|
|
102
|
-
|
|
89
|
+
Autograd:
|
|
103
90
|
|
|
104
91
|
- `backward(gradient=None)`
|
|
105
92
|
- `zero_grad()`
|
|
106
93
|
|
|
107
|
-
`backward()` without a gradient is only valid for scalar outputs.
|
|
108
|
-
|
|
109
94
|
## Operators
|
|
110
95
|
|
|
111
96
|
TensorStudio overloads common Python operators:
|
|
@@ -144,7 +129,7 @@ Optimizers implement `zero_grad()` and `step()`.
|
|
|
144
129
|
|
|
145
130
|
## Error Types
|
|
146
131
|
|
|
147
|
-
|
|
132
|
+
Import native exception aliases from `tensorstudio.errors`:
|
|
148
133
|
|
|
149
134
|
- `TensorStudioError`
|
|
150
135
|
- `ShapeError`
|
|
@@ -152,8 +137,6 @@ The native extension maps C++ exceptions to Python exceptions:
|
|
|
152
137
|
- `DeviceError`
|
|
153
138
|
- `AutogradError`
|
|
154
139
|
|
|
155
|
-
Import them from `tensorstudio.errors`.
|
|
156
|
-
|
|
157
140
|
## Serialization
|
|
158
141
|
|
|
159
142
|
```python
|
|
@@ -161,4 +144,4 @@ ts.save(obj, "object.tsmodel")
|
|
|
161
144
|
loaded = ts.load("object.tsmodel")
|
|
162
145
|
```
|
|
163
146
|
|
|
164
|
-
Serialization uses pickle in v0.1.
|
|
147
|
+
Serialization uses pickle in v0.1.x. Only load files from trusted sources.
|
|
@@ -22,7 +22,7 @@ TensorStudio builds a C++20 extension module named `tensorstudio._C`.
|
|
|
22
22
|
Windows:
|
|
23
23
|
|
|
24
24
|
```powershell
|
|
25
|
-
# Use a Visual Studio Developer PowerShell, or
|
|
25
|
+
# Use a Visual Studio Developer PowerShell, or install wheels from PyPI.
|
|
26
26
|
python -m pip install -e ".[dev]"
|
|
27
27
|
```
|
|
28
28
|
|
|
@@ -40,6 +40,9 @@ sudo apt-get install build-essential cmake
|
|
|
40
40
|
python -m pip install -e ".[dev]"
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
End users should normally install prebuilt wheels from PyPI and should not need
|
|
44
|
+
CMake or a compiler.
|
|
45
|
+
|
|
43
46
|
## Development Install
|
|
44
47
|
|
|
45
48
|
```bash
|
|
@@ -93,14 +96,8 @@ as superior to mature ML frameworks.
|
|
|
93
96
|
|
|
94
97
|
## Testing Strategy
|
|
95
98
|
|
|
96
|
-
Add tests for
|
|
97
|
-
|
|
98
|
-
- Tensor creation and dtype behavior
|
|
99
|
-
- Broadcasting and shape errors
|
|
100
|
-
- NumPy numerical comparisons
|
|
101
|
-
- Autograd gradients for new differentiable ops
|
|
102
|
-
- Python module or optimizer behavior
|
|
103
|
-
- Serialization roundtrips
|
|
99
|
+
Add tests for tensor creation, dtype handling, broadcasting, shape errors, NumPy
|
|
100
|
+
comparisons, autograd gradients, modules, optimizers, and serialization.
|
|
104
101
|
|
|
105
102
|
For numerical tests, prefer `np.testing.assert_allclose`.
|
|
106
103
|
|
|
@@ -116,5 +113,5 @@ python -m build
|
|
|
116
113
|
twine check dist/*
|
|
117
114
|
```
|
|
118
115
|
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
Wheels are built in CI with cibuildwheel so users can install without a local
|
|
117
|
+
C++ toolchain.
|
|
@@ -11,7 +11,7 @@ examples, benchmarks, and release tooling.
|
|
|
11
11
|
|
|
12
12
|
## Project Status
|
|
13
13
|
|
|
14
|
-
TensorStudio v0.1.
|
|
14
|
+
TensorStudio v0.1.1 is experimental. It is useful for learning how tensor
|
|
15
15
|
frameworks are assembled, for small experiments, and for lightweight workloads.
|
|
16
16
|
It is not a replacement for mature production ML frameworks.
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ It is not a replacement for mature production ML frameworks.
|
|
|
23
23
|
- NumPy-style broadcasting for binary elementwise operations.
|
|
24
24
|
- Matrix multiplication for 2D tensors.
|
|
25
25
|
- Scalar reductions, common activations, reshape, flatten, and 2D transpose.
|
|
26
|
-
- Reverse-mode autograd for the v0.1.
|
|
26
|
+
- Reverse-mode autograd for the v0.1.x operation set.
|
|
27
27
|
- Python `nn.Module`, `Parameter`, `Linear`, `Sequential`, activations, and
|
|
28
28
|
`MSELoss`.
|
|
29
29
|
- Python `optim.SGD` and `optim.Adam`.
|
|
@@ -42,7 +42,7 @@ TensorStudio prioritizes:
|
|
|
42
42
|
|
|
43
43
|
## Current Boundaries
|
|
44
44
|
|
|
45
|
-
TensorStudio v0.1.
|
|
45
|
+
TensorStudio v0.1.1 is CPU-only. It has no CUDA backend, no graph compiler, no
|
|
46
46
|
distributed runtime, no advanced indexing, no sparse tensors, and limited dtype
|
|
47
47
|
casting. Serialization uses pickle, so loading untrusted files is unsafe.
|
|
48
48
|
|
|
@@ -13,8 +13,8 @@ long-lived PyPI tokens in developer environments.
|
|
|
13
13
|
4. Create and push a version tag:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
git tag v0.1.
|
|
17
|
-
git push origin v0.1.
|
|
16
|
+
git tag v0.1.1
|
|
17
|
+
git push origin v0.1.1
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
5. Publish a GitHub release, or manually run the publish workflow.
|
|
@@ -7,7 +7,7 @@ build-backend = "scikit_build_core.build"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "tensorstudio"
|
|
10
|
-
version = "0.1.
|
|
10
|
+
version = "0.1.1"
|
|
11
11
|
description = "TensorStudio is a compact C++ tensor and autograd engine with a Python API for learning, experimentation, and lightweight ML workloads."
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.10"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Serialization helpers.
|
|
2
2
|
|
|
3
|
-
TensorStudio v0.1.
|
|
3
|
+
TensorStudio v0.1.x uses pickle for internal object roundtrips. Loading pickle
|
|
4
4
|
data from untrusted sources is unsafe because pickle can execute arbitrary code
|
|
5
5
|
during deserialization.
|
|
6
6
|
"""
|
|
@@ -111,11 +111,11 @@ py::list nested_list_from_tensor(const Tensor& tensor, std::size_t dim, int64_t&
|
|
|
111
111
|
return result;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
std::vector<ssize_t> ssize_shape(const Shape& shape) {
|
|
115
|
-
std::vector<ssize_t> result;
|
|
114
|
+
std::vector<py::ssize_t> ssize_shape(const Shape& shape) {
|
|
115
|
+
std::vector<py::ssize_t> result;
|
|
116
116
|
result.reserve(shape.size());
|
|
117
117
|
for (const auto dim : shape) {
|
|
118
|
-
result.push_back(static_cast<ssize_t>(dim));
|
|
118
|
+
result.push_back(static_cast<py::ssize_t>(dim));
|
|
119
119
|
}
|
|
120
120
|
return result;
|
|
121
121
|
}
|
|
@@ -201,7 +201,7 @@ Tensor tensor_from_numpy(py::array array, bool requires_grad) {
|
|
|
201
201
|
py::array flat = py::reinterpret_borrow<py::array>(contiguous.attr("ravel")());
|
|
202
202
|
std::vector<double> values;
|
|
203
203
|
values.reserve(static_cast<std::size_t>(flat.size()));
|
|
204
|
-
for (ssize_t i = 0; i < flat.size(); ++i) {
|
|
204
|
+
for (py::ssize_t i = 0; i < flat.size(); ++i) {
|
|
205
205
|
values.push_back(py::cast<double>(flat.attr("__getitem__")(i)));
|
|
206
206
|
}
|
|
207
207
|
return Tensor::from_flat_values(values, shape, dtype, requires_grad);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
namespace tensorstudio {
|
|
4
4
|
|
|
5
5
|
std::string serialization_note() {
|
|
6
|
-
return "TensorStudio Python serialization uses pickle for v0.1.
|
|
6
|
+
return "TensorStudio Python serialization uses pickle for v0.1.x internal objects.";
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
} // namespace tensorstudio
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|