torch-rb 0.17.1 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +15 -18
- data/codegen/generate_functions.rb +3 -1
- data/codegen/native_functions.yaml +351 -178
- data/ext/torch/device.cpp +6 -1
- data/ext/torch/ext.cpp +1 -1
- data/ext/torch/tensor.cpp +2 -4
- data/ext/torch/torch.cpp +7 -12
- data/ext/torch/utils.h +1 -1
- data/lib/torch/device.rb +25 -0
- data/lib/torch/tensor.rb +6 -0
- data/lib/torch/version.rb +1 -1
- data/lib/torch.rb +6 -1
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03164cc479d8f8a32f0669d597e8fe5310d91955e6954cfdc0fffdc8983c5768
|
4
|
+
data.tar.gz: 87fc733016b6f4489b38a419a3879cacbdb1e190cfaa5c02397aceb57c012d16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ba0480138a10ba43dff625dc1bcf99e2287f238dc4607ea6813e82914f1e335133f55408fa59579343b161c54850316f744c594cf6687b7f2de64a0d71746d1
|
7
|
+
data.tar.gz: 859015641dd14bf919a7982c6673acb296f858518552b8c924fc7e59b9c1b2a9491aa598c01b019b392c8c2bba7b9f65ff0923f838e6cbde7ddaede9c4b69191
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 0.19.0 (2025-01-29)
|
2
|
+
|
3
|
+
- Updated LibTorch to 2.6.0
|
4
|
+
- Improved `inspect` for `Device`
|
5
|
+
- Fixed equality for `Device`
|
6
|
+
- Fixed `index` method for `Device` when no index
|
7
|
+
|
8
|
+
## 0.18.0 (2024-10-22)
|
9
|
+
|
10
|
+
- Updated LibTorch to 2.5.0
|
11
|
+
|
1
12
|
## 0.17.1 (2024-08-19)
|
2
13
|
|
3
14
|
- Added `persistent` option to `register_buffer` method
|
data/README.md
CHANGED
@@ -14,13 +14,22 @@ Check out:
|
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
17
|
-
First, [
|
17
|
+
First, [download LibTorch](https://pytorch.org/get-started/locally/). For Mac arm64, use:
|
18
18
|
|
19
19
|
```sh
|
20
|
-
|
20
|
+
curl -L https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.6.0.zip > libtorch.zip
|
21
|
+
unzip -q libtorch.zip
|
21
22
|
```
|
22
23
|
|
23
|
-
|
24
|
+
For Linux x86-64, use the `cxx11 ABI` version. For other platforms, build LibTorch from source.
|
25
|
+
|
26
|
+
Then run:
|
27
|
+
|
28
|
+
```sh
|
29
|
+
bundle config build.torch-rb --with-torch-dir=/path/to/libtorch
|
30
|
+
```
|
31
|
+
|
32
|
+
And add this line to your application’s Gemfile:
|
24
33
|
|
25
34
|
```ruby
|
26
35
|
gem "torch-rb"
|
@@ -398,18 +407,14 @@ Here’s a list of functions to create tensors (descriptions from the [C++ docs]
|
|
398
407
|
Torch.zeros(3) # tensor([0, 0, 0])
|
399
408
|
```
|
400
409
|
|
401
|
-
## LibTorch
|
402
|
-
|
403
|
-
[Download LibTorch](https://pytorch.org/) (for Linux, use the `cxx11 ABI` version). Then run:
|
404
|
-
|
405
|
-
```sh
|
406
|
-
bundle config build.torch-rb --with-torch-dir=/path/to/libtorch
|
407
|
-
```
|
410
|
+
## LibTorch Compatibility
|
408
411
|
|
409
412
|
Here’s the list of compatible versions.
|
410
413
|
|
411
414
|
Torch.rb | LibTorch
|
412
415
|
--- | ---
|
416
|
+
0.19.x | 2.6.x
|
417
|
+
0.18.x | 2.5.x
|
413
418
|
0.17.x | 2.4.x
|
414
419
|
0.16.x | 2.3.x
|
415
420
|
0.15.x | 2.2.x
|
@@ -417,14 +422,6 @@ Torch.rb | LibTorch
|
|
417
422
|
0.13.x | 2.0.x
|
418
423
|
0.12.x | 1.13.x
|
419
424
|
|
420
|
-
### Homebrew
|
421
|
-
|
422
|
-
You can also use Homebrew.
|
423
|
-
|
424
|
-
```sh
|
425
|
-
brew install pytorch
|
426
|
-
```
|
427
|
-
|
428
425
|
## Performance
|
429
426
|
|
430
427
|
Deep learning is significantly faster on a GPU.
|
@@ -53,7 +53,9 @@ def skip_functions(functions)
|
|
53
53
|
f.base_name == "sym_size" ||
|
54
54
|
f.base_name == "sym_numel" ||
|
55
55
|
f.base_name == "sym_storage_offset" ||
|
56
|
-
f.base_name == "sym_stride"
|
56
|
+
f.base_name == "sym_stride" ||
|
57
|
+
# TODO fix LibTorch 2.6 changes
|
58
|
+
f.base_name == "rrelu_with_noise"
|
57
59
|
end
|
58
60
|
end
|
59
61
|
|