torch-rb 0.19.0 → 0.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/torch/templates.h +12 -16
- data/ext/torch/torch.cpp +7 -1
- data/lib/torch/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9f66d5afde49c37ed2a09e199932ba35345f898176dd92953b83bc60dec922f
|
4
|
+
data.tar.gz: 2d8887d224868e933a13c2a7b39c6053f93abeaf20c13bea538a82a559bf03db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97ebd44f663bffb2169b3a071c43d007492e92a44cb6166f516a6dca73948946b79d53ba54fa05dd887e248426edc7b81cf1e666699a99596ac6b14e6aedcc22
|
7
|
+
data.tar.gz: 57196b65d5e3fe50fc2209f1b0ec4a5bcdad1dba525053a73bc71c13618d6d8f81c5628d14c156a9e5c96f5b666195c0b3ee90832fe6f1f8ccd1e8c200e3769a
|
data/CHANGELOG.md
CHANGED
data/ext/torch/templates.h
CHANGED
@@ -46,10 +46,7 @@ namespace Rice::detail
|
|
46
46
|
template<typename T>
|
47
47
|
struct Type<c10::complex<T>>
|
48
48
|
{
|
49
|
-
static bool verify()
|
50
|
-
{
|
51
|
-
return true;
|
52
|
-
}
|
49
|
+
static bool verify() { return true; }
|
53
50
|
};
|
54
51
|
|
55
52
|
template<typename T>
|
@@ -66,6 +63,8 @@ namespace Rice::detail
|
|
66
63
|
class From_Ruby<c10::complex<T>>
|
67
64
|
{
|
68
65
|
public:
|
66
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
67
|
+
|
69
68
|
c10::complex<T> convert(VALUE x)
|
70
69
|
{
|
71
70
|
VALUE real = rb_funcall(x, rb_intern("real"), 0);
|
@@ -80,16 +79,15 @@ namespace Rice::detail
|
|
80
79
|
template<>
|
81
80
|
struct Type<FanModeType>
|
82
81
|
{
|
83
|
-
static bool verify()
|
84
|
-
{
|
85
|
-
return true;
|
86
|
-
}
|
82
|
+
static bool verify() { return true; }
|
87
83
|
};
|
88
84
|
|
89
85
|
template<>
|
90
86
|
class From_Ruby<FanModeType>
|
91
87
|
{
|
92
88
|
public:
|
89
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
90
|
+
|
93
91
|
FanModeType convert(VALUE x)
|
94
92
|
{
|
95
93
|
auto s = String(x).str();
|
@@ -106,16 +104,15 @@ namespace Rice::detail
|
|
106
104
|
template<>
|
107
105
|
struct Type<NonlinearityType>
|
108
106
|
{
|
109
|
-
static bool verify()
|
110
|
-
{
|
111
|
-
return true;
|
112
|
-
}
|
107
|
+
static bool verify() { return true; }
|
113
108
|
};
|
114
109
|
|
115
110
|
template<>
|
116
111
|
class From_Ruby<NonlinearityType>
|
117
112
|
{
|
118
113
|
public:
|
114
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
115
|
+
|
119
116
|
NonlinearityType convert(VALUE x)
|
120
117
|
{
|
121
118
|
auto s = String(x).str();
|
@@ -150,16 +147,15 @@ namespace Rice::detail
|
|
150
147
|
template<>
|
151
148
|
struct Type<Scalar>
|
152
149
|
{
|
153
|
-
static bool verify()
|
154
|
-
{
|
155
|
-
return true;
|
156
|
-
}
|
150
|
+
static bool verify() { return true; }
|
157
151
|
};
|
158
152
|
|
159
153
|
template<>
|
160
154
|
class From_Ruby<Scalar>
|
161
155
|
{
|
162
156
|
public:
|
157
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
158
|
+
|
163
159
|
Scalar convert(VALUE x)
|
164
160
|
{
|
165
161
|
if (FIXNUM_P(x)) {
|
data/ext/torch/torch.cpp
CHANGED
@@ -21,7 +21,13 @@ torch::Tensor make_tensor(Rice::Array a, const std::vector<int64_t> &size, const
|
|
21
21
|
}
|
22
22
|
|
23
23
|
void init_torch(Rice::Module& m) {
|
24
|
-
|
24
|
+
Rice::detail::Registries::instance.handlers.set([]() {
|
25
|
+
try {
|
26
|
+
throw;
|
27
|
+
} catch (const torch::Error& ex) {
|
28
|
+
handle_global_error(ex);
|
29
|
+
}
|
30
|
+
});
|
25
31
|
add_torch_functions(m);
|
26
32
|
m.define_singleton_function(
|
27
33
|
"grad_enabled?",
|
data/lib/torch/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torch-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.19.
|
4
|
+
version: 0.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rice
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 4.
|
18
|
+
version: '4.5'
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 4.
|
25
|
+
version: '4.5'
|
26
26
|
email: andrew@ankane.org
|
27
27
|
executables: []
|
28
28
|
extensions:
|