torch-rb 0.5.0 → 0.7.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 +26 -0
- data/README.md +13 -4
- data/codegen/generate_functions.rb +13 -14
- data/codegen/native_functions.yaml +2355 -1396
- data/ext/torch/cuda.cpp +14 -0
- data/ext/torch/device.cpp +28 -0
- data/ext/torch/ext.cpp +26 -613
- data/ext/torch/extconf.rb +1 -4
- data/ext/torch/ivalue.cpp +132 -0
- data/ext/torch/nn.cpp +114 -0
- data/ext/torch/nn_functions.h +1 -1
- data/ext/torch/random.cpp +22 -0
- data/ext/torch/ruby_arg_parser.cpp +3 -3
- data/ext/torch/ruby_arg_parser.h +37 -16
- data/ext/torch/templates.h +110 -133
- data/ext/torch/tensor.cpp +320 -0
- data/ext/torch/tensor_functions.h +1 -1
- data/ext/torch/torch.cpp +95 -0
- data/ext/torch/torch_functions.h +1 -1
- data/ext/torch/utils.h +8 -2
- data/ext/torch/wrap_outputs.h +72 -65
- data/lib/torch.rb +19 -17
- data/lib/torch/inspector.rb +5 -2
- data/lib/torch/nn/linear.rb +2 -0
- data/lib/torch/nn/module.rb +107 -21
- data/lib/torch/nn/parameter.rb +1 -1
- data/lib/torch/tensor.rb +9 -0
- data/lib/torch/utils/data/data_loader.rb +1 -1
- data/lib/torch/version.rb +1 -1
- metadata +14 -91
data/lib/torch/nn/parameter.rb
CHANGED
data/lib/torch/tensor.rb
CHANGED
@@ -135,6 +135,10 @@ module Torch
|
|
135
135
|
Torch.ones_like(Torch.empty(*size), **options)
|
136
136
|
end
|
137
137
|
|
138
|
+
def requires_grad=(requires_grad)
|
139
|
+
_requires_grad!(requires_grad)
|
140
|
+
end
|
141
|
+
|
138
142
|
def requires_grad!(requires_grad = true)
|
139
143
|
_requires_grad!(requires_grad)
|
140
144
|
end
|
@@ -174,5 +178,10 @@ module Torch
|
|
174
178
|
return _random!(0, *args) if args.size == 1
|
175
179
|
_random!(*args)
|
176
180
|
end
|
181
|
+
|
182
|
+
# center option
|
183
|
+
def stft(*args)
|
184
|
+
Torch.stft(*args)
|
185
|
+
end
|
177
186
|
end
|
178
187
|
end
|
data/lib/torch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torch-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rice
|
@@ -16,100 +16,16 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake-compiler
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: minitest
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '5'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '5'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: numo-narray
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: torchvision
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 0.1.1
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.1.1
|
26
|
+
version: 4.0.2
|
111
27
|
description:
|
112
|
-
email: andrew@
|
28
|
+
email: andrew@ankane.org
|
113
29
|
executables: []
|
114
30
|
extensions:
|
115
31
|
- ext/torch/extconf.rb
|
@@ -121,13 +37,20 @@ files:
|
|
121
37
|
- codegen/function.rb
|
122
38
|
- codegen/generate_functions.rb
|
123
39
|
- codegen/native_functions.yaml
|
40
|
+
- ext/torch/cuda.cpp
|
41
|
+
- ext/torch/device.cpp
|
124
42
|
- ext/torch/ext.cpp
|
125
43
|
- ext/torch/extconf.rb
|
44
|
+
- ext/torch/ivalue.cpp
|
45
|
+
- ext/torch/nn.cpp
|
126
46
|
- ext/torch/nn_functions.h
|
47
|
+
- ext/torch/random.cpp
|
127
48
|
- ext/torch/ruby_arg_parser.cpp
|
128
49
|
- ext/torch/ruby_arg_parser.h
|
129
50
|
- ext/torch/templates.h
|
51
|
+
- ext/torch/tensor.cpp
|
130
52
|
- ext/torch/tensor_functions.h
|
53
|
+
- ext/torch/torch.cpp
|
131
54
|
- ext/torch/torch_functions.h
|
132
55
|
- ext/torch/utils.h
|
133
56
|
- ext/torch/wrap_outputs.h
|
@@ -282,14 +205,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
282
205
|
requirements:
|
283
206
|
- - ">="
|
284
207
|
- !ruby/object:Gem::Version
|
285
|
-
version: '2.
|
208
|
+
version: '2.6'
|
286
209
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
287
210
|
requirements:
|
288
211
|
- - ">="
|
289
212
|
- !ruby/object:Gem::Version
|
290
213
|
version: '0'
|
291
214
|
requirements: []
|
292
|
-
rubygems_version: 3.
|
215
|
+
rubygems_version: 3.2.3
|
293
216
|
signing_key:
|
294
217
|
specification_version: 4
|
295
218
|
summary: Deep learning for Ruby, powered by LibTorch
|