torch-rb 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd10ea76fc9cde319cad48a1b3bd298384c4f47812d9be5ee9016c44151458a0
4
- data.tar.gz: e8391c2bc4ccae67ca0c2e402e431e99a683023285952edbd3f011a18793dfb6
3
+ metadata.gz: 7884d0bd8ffd23e775b3a1ca59e536bc18cd79c6bbe2736a9802a2b1693d40de
4
+ data.tar.gz: 10849c8a248a70eca7178ca3529fa7428fc3d8e5cfe2ca774b0be6cb5e75eb9b
5
5
  SHA512:
6
- metadata.gz: c290b76e1d18e88c46ec2bd544471cc5922de4741a0095786ba00415b2fa6ae52023b0c296365a7af6a81143515c36ccd3dbe69d11aea5138fbcd81b6e687bf6
7
- data.tar.gz: bc35fd6f9c9ed38b12caf98158f61a6d9827e967c36f8fbcf46f64331cc96c03de3105f4bc0b5b70c911d25ce223ea0085c18537cff677e84bf3d564ce0058ab
6
+ metadata.gz: d81587eae00527e9d1e4a65b62a686dbdab27eed9401539faddf553d3a0730ad7394b01bac615bdd0474d1a6602cd0a3117e1d7cb3a3f1d5fbf8bd989fa39e59
7
+ data.tar.gz: d581d07821f103ee69267bc8e6b15d5094d8b8ef004917af947e2570649e7fbe750c9893d40600b62ee970646654fc545a270e7a59adb764be2ba73f1fa18b62
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.10.0 (2022-03-13)
2
+
3
+ - Updated LibTorch to 1.11.0
4
+ - Added `ParameterList`
5
+
1
6
  ## 0.9.2 (2022-02-03)
2
7
 
3
8
  - Added support for setting `nil` gradient
data/README.md CHANGED
@@ -7,6 +7,7 @@ Check out:
7
7
  - [TorchVision](https://github.com/ankane/torchvision) for computer vision tasks
8
8
  - [TorchText](https://github.com/ankane/torchtext) for text and NLP tasks
9
9
  - [TorchAudio](https://github.com/ankane/torchaudio) for audio tasks
10
+ - [TorchRec](https://github.com/ankane/torchrec-ruby) for recommendation systems
10
11
 
11
12
  [![Build Status](https://github.com/ankane/torch.rb/workflows/build/badge.svg?branch=master)](https://github.com/ankane/torch.rb/actions)
12
13
 
@@ -408,7 +409,8 @@ Here’s the list of compatible versions.
408
409
 
409
410
  Torch.rb | LibTorch
410
411
  --- | ---
411
- 0.9.0+ | 1.10.0+
412
+ 0.10.0+ | 1.11.0+
413
+ 0.9.0-0.9.2 | 1.10.0-1.10.2
412
414
  0.8.0-0.8.3 | 1.9.0-1.9.1
413
415
  0.6.0-0.7.0 | 1.8.0-1.8.1
414
416
  0.5.0-0.5.3 | 1.7.0-1.7.1
data/codegen/function.rb CHANGED
@@ -37,7 +37,7 @@ class Function
37
37
  private
38
38
 
39
39
  def parse_func
40
- input, output = func.split(/\s*->\s*/)
40
+ input, _, output = func.rpartition(/\s+->\s+/)
41
41
  [generate_params(input), generate_retvals(output)]
42
42
  end
43
43
 
@@ -52,7 +52,7 @@ class Function
52
52
  next
53
53
  end
54
54
 
55
- type, name = i.split(/\s+/)
55
+ type, _, name = i.rpartition(/\s+/)
56
56
 
57
57
  if name.include?("=")
58
58
  name, default = name.split("=", 2)
@@ -14,6 +14,7 @@ def generate_functions
14
14
  generate_files("fft", :define_singleton_method, functions[:fft])
15
15
  generate_files("linalg", :define_singleton_method, functions[:linalg])
16
16
  generate_files("special", :define_singleton_method, functions[:special])
17
+ generate_files("sparse", :define_singleton_method, functions[:sparse])
17
18
  end
18
19
 
19
20
  def load_functions
@@ -47,6 +48,7 @@ def group_functions(functions)
47
48
  linalg_functions, other_functions = other_functions.partition { |f| f.python_module == "linalg" }
48
49
  fft_functions, other_functions = other_functions.partition { |f| f.python_module == "fft" }
49
50
  special_functions, other_functions = other_functions.partition { |f| f.python_module == "special" }
51
+ sparse_functions, other_functions = other_functions.partition { |f| f.python_module == "sparse" }
50
52
  unexpected_functions, other_functions = other_functions.partition { |f| f.python_module }
51
53
  torch_functions = other_functions.select { |f| f.variants.include?("function") }
52
54
  tensor_functions = other_functions.select { |f| f.variants.include?("method") }
@@ -62,7 +64,8 @@ def group_functions(functions)
62
64
  nn: nn_functions,
63
65
  linalg: linalg_functions,
64
66
  fft: fft_functions,
65
- special: special_functions
67
+ special: special_functions,
68
+ sparse: sparse_functions
66
69
  }
67
70
  end
68
71
 
@@ -136,6 +139,7 @@ def generate_attach_def(name, type, def_method)
136
139
  ruby_name = ruby_name.sub(/\Afft_/, "") if type == "fft"
137
140
  ruby_name = ruby_name.sub(/\Alinalg_/, "") if type == "linalg"
138
141
  ruby_name = ruby_name.sub(/\Aspecial_/, "") if type == "special"
142
+ ruby_name = ruby_name.sub(/\Asparse_/, "") if type == "sparse"
139
143
  ruby_name = name if name.start_with?("__")
140
144
 
141
145
  # cast for Ruby < 2.7 https://github.com/thisMagpie/fftw/issues/22#issuecomment-49508900