red-candle 0.0.3 → 0.0.4

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.
@@ -0,0 +1,17 @@
1
+ module Candle
2
+ class Tensor
3
+ include Enumerable
4
+
5
+ def each
6
+ if self.rank == 1
7
+ self.values.each do |value|
8
+ yield value
9
+ end
10
+ else
11
+ shape.first.times do |i|
12
+ yield self[i]
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Candle
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
data/lib/candle.rb CHANGED
@@ -1 +1,2 @@
1
1
  require_relative 'candle/candle'
2
+ require_relative 'candle/tensor'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red-candle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-28 00:00:00.000000000 Z
11
+ date: 2024-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys
@@ -32,19 +32,19 @@ extensions:
32
32
  - ext/candle/extconf.rb
33
33
  extra_rdoc_files: []
34
34
  files:
35
- - Cargo.lock
36
35
  - Cargo.toml
37
36
  - README.md
38
37
  - ext/candle/Cargo.toml
39
38
  - ext/candle/extconf.rb
40
39
  - ext/candle/src/lib.rs
41
40
  - lib/candle.rb
41
+ - lib/candle/tensor.rb
42
42
  - lib/candle/version.rb
43
43
  homepage: https://github.com/kojix2/red-candle
44
44
  licenses:
45
45
  - MIT
46
46
  metadata: {}
47
- post_install_message:
47
+ post_install_message:
48
48
  rdoc_options: []
49
49
  require_paths:
50
50
  - lib
@@ -60,8 +60,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: 3.3.26
61
61
  requirements:
62
62
  - Rust >= 1.61
63
- rubygems_version: 3.4.10
64
- signing_key:
63
+ rubygems_version: 3.5.3
64
+ signing_key:
65
65
  specification_version: 4
66
66
  summary: huggingface/candle for ruby
67
67
  test_files: []