torch-rb 0.16.0 → 0.17.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8442fc0f85d6f2465258a54e5aefbe03d23a7c0e58753e06855bfebd2f4de802
4
- data.tar.gz: ac0efb89f9b6d413498bfb1c2e84336aa728047dd013d00fa736449e5be82617
3
+ metadata.gz: f04aeddd9c66d668f78ed38d831ec66907743fd5be2cd076e9e547d00f1f2aa3
4
+ data.tar.gz: e76ca5199c4801c0eaa760ed3e41ebb6e521774bba084809656b1ed9e4b96483
5
5
  SHA512:
6
- metadata.gz: 6830efe74de98fc8a8d23e7308795a60ee60fff72b3f82fa7cb92815f4efe52fdf3637e0821490f5e3e8c2c8731043f52f5aff20cfb01db1340be0962fed18db
7
- data.tar.gz: 3e50976e5add37b4158956c76e3c922167911492acda9e171af42ad39d5abe946c36427e545d9fc820a2800e3df0523b0068ce76b804d0c05a6f1e2ad495de01
6
+ metadata.gz: 683246aa91d19daa624a9d3a89fa5e4898f19fbb45a72ff2bcac0ee3025859f0f8ad26ac153e58150aedf10547cf670e2fe131cffda246546ded1f1344637040
7
+ data.tar.gz: bd0b955b997f09a274d8b59a21eafa8bf45972b6a20883b9d457a29417aa2c6d413b324abadfb6772c5bdc3aa0e633d3e25d6f23dd986fa603c55c69ae4a5a85
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 0.17.1 (2024-08-19)
2
+
3
+ - Added `persistent` option to `register_buffer` method
4
+ - Added `prefix` and `recurse` options to `named_buffers` method
5
+
6
+ ## 0.17.0 (2024-07-26)
7
+
8
+ - Updated LibTorch to 2.4.0
9
+ - Added `normalize` method
10
+ - Added support for tensor indexing with arrays
11
+
1
12
  ## 0.16.0 (2024-06-12)
2
13
 
3
14
  - Updated LibTorch to 2.3.0
data/README.md CHANGED
@@ -26,7 +26,7 @@ Add this line to your application’s Gemfile:
26
26
  gem "torch-rb"
27
27
  ```
28
28
 
29
- It can take 5-10 minutes to compile the extension.
29
+ It can take 5-10 minutes to compile the extension. Windows is not currently supported.
30
30
 
31
31
  ## Getting Started
32
32
 
@@ -410,6 +410,7 @@ Here’s the list of compatible versions.
410
410
 
411
411
  Torch.rb | LibTorch
412
412
  --- | ---
413
+ 0.17.x | 2.4.x
413
414
  0.16.x | 2.3.x
414
415
  0.15.x | 2.2.x
415
416
  0.14.x | 2.1.x
@@ -155,10 +155,10 @@ def generate_attach_def(name, type, def_method)
155
155
  end
156
156
 
157
157
  ruby_name = "_#{ruby_name}" if ["size", "stride", "random!"].include?(ruby_name)
158
- ruby_name = ruby_name.sub(/\Afft_/, "") if type == "fft"
159
- ruby_name = ruby_name.sub(/\Alinalg_/, "") if type == "linalg"
160
- ruby_name = ruby_name.sub(/\Aspecial_/, "") if type == "special"
161
- ruby_name = ruby_name.sub(/\Asparse_/, "") if type == "sparse"
158
+ ruby_name = ruby_name.delete_prefix("fft_") if type == "fft"
159
+ ruby_name = ruby_name.delete_prefix("linalg_") if type == "linalg"
160
+ ruby_name = ruby_name.delete_prefix("special_") if type == "special"
161
+ ruby_name = ruby_name.delete_prefix("sparse_") if type == "sparse"
162
162
  ruby_name = name if name.start_with?("__")
163
163
 
164
164
  "rb_#{def_method}(m, \"#{ruby_name}\", #{full_name(name, type)}, -1);"
@@ -216,7 +216,7 @@ def add_dispatch(function, def_method)
216
216
  out_code = generate_dispatch(function["out"], def_method)
217
217
  out_index = function["out"].out_index
218
218
 
219
- return "if (_r.isNone(#{out_index})) {
219
+ "if (_r.isNone(#{out_index})) {
220
220
  #{indent(base_code)}
221
221
  } else {
222
222
  #{indent(out_code)}
@@ -439,7 +439,7 @@ def generate_function_params(function, params, remove_self)
439
439
  else
440
440
  "#{func}Optional"
441
441
  end
442
- end
442
+ end
443
443
 
444
444
  "_r.#{func}(#{param[:position]})"
445
445
  end