tensorflow.py 0.3.0 → 0.4.0

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: 29333aedb9569c021b2fd9827f015783a7d9a9d1144aa3132df207f0b4a4da08
4
- data.tar.gz: 9bb29141c6842455b27128734afdb2d15286cd138c0e5f1a1c679a8fe64a9045
3
+ metadata.gz: a0efce0d1c2dba551eaa730b8d80c207cce60c8c4cbd95f68310cabe14ac5cdc
4
+ data.tar.gz: 3cfaf2a57443c80853e60d26ce2ee62c577f1d35035b077de9e7e55c89a26879
5
5
  SHA512:
6
- metadata.gz: 8243c30e8d197b9e7bd6d24c64a33898b6bd441b502c1e1e21b23cb8b2c0770dfae767b441c9e26436d48e001be12683815283af3967ad7a3ffa4897bd7678d8
7
- data.tar.gz: 3d98836eeaf70457bf39db2060905e13fdafbacc72b3ae1eca87644d5552e9dd70f1501c0be4e8a7529c3c17c06c087af09b5a88e01ed195b6ea540fbefcfc7d
6
+ metadata.gz: a2078bf7f51cfcd17a795abafa863f3400f1273fe805e41379211766fe58c5e2eea0302c47308db50fd7d38d91ec1bd9f9f28293c006d95d68d378e3371de478
7
+ data.tar.gz: 2baaeb1e088ff51c7e11ee0e1776790959bb750381467b518a53a6b672de713771395df1290faef736fae21a22692501b619bc62bd90dcb3855bbaaffc38fb11
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ Gemfile.lock
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /_yardoc/
data/README.md CHANGED
@@ -24,12 +24,18 @@ Or install it yourself as:
24
24
  require 'tensorflow'
25
25
 
26
26
  tf = TensorFlow
27
- sess = tf.Session.call
27
+ sess = tf.Session.new
28
28
  a = tf.placeholder tf.int16
29
29
  b = tf.placeholder tf.int16
30
30
  add = tf.add(a, b)
31
31
  mul = tf.multiply(a, b)
32
32
  result = sess.run(add, feed_dict: { a => 2, b => 3 })
33
+ sess.close
34
+
35
+ # block sugar closes the session
36
+ tf.session do |sess|
37
+ sess.run(mul, feed_dict: { a => 2, b => 3 })
38
+ end
33
39
  ```
34
40
 
35
41
  ## Development
@@ -17,4 +17,9 @@ module TensorFlow
17
17
  def self.respond_to_missing?(method_name, include_private = false)
18
18
  _pym.respond_to?(method_name, include_private)
19
19
  end
20
+
21
+ def self.session(*args, &block)
22
+ s = self.Session.new(*args)
23
+ block ? yield(s).tap { s.close } : s
24
+ end
20
25
  end
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'tensorflow.py'
6
- spec.version = '0.3.0'
6
+ spec.version = '0.4.0'
7
7
  spec.authors = ['Frank J. Cameron']
8
8
  spec.email = ['fjc@fastmail.net']
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tensorflow.py
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank J. Cameron
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-04 00:00:00.000000000 Z
11
+ date: 2018-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,7 +106,6 @@ files:
106
106
  - ".rspec"
107
107
  - ".travis.yml"
108
108
  - Gemfile
109
- - Gemfile.lock
110
109
  - LICENSE.txt
111
110
  - README.md
112
111
  - Rakefile
@@ -1,63 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- tensorflow.py (0.3.0)
5
- ruby.py (~> 0.2)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ast (2.4.0)
11
- coderay (1.1.2)
12
- diff-lcs (1.3)
13
- jaro_winkler (1.5.1)
14
- method_source (0.9.0)
15
- parallel (1.12.1)
16
- parser (2.5.1.0)
17
- ast (~> 2.4.0)
18
- powerpack (0.1.2)
19
- pry (0.11.3)
20
- coderay (~> 1.1.0)
21
- method_source (~> 0.9.0)
22
- pycall (1.0.3)
23
- rainbow (3.0.0)
24
- rake (10.5.0)
25
- rspec (3.7.0)
26
- rspec-core (~> 3.7.0)
27
- rspec-expectations (~> 3.7.0)
28
- rspec-mocks (~> 3.7.0)
29
- rspec-core (3.7.1)
30
- rspec-support (~> 3.7.0)
31
- rspec-expectations (3.7.0)
32
- diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.7.0)
34
- rspec-mocks (3.7.0)
35
- diff-lcs (>= 1.2.0, < 2.0)
36
- rspec-support (~> 3.7.0)
37
- rspec-support (3.7.1)
38
- rubocop (0.57.2)
39
- jaro_winkler (~> 1.5.1)
40
- parallel (~> 1.10)
41
- parser (>= 2.5)
42
- powerpack (~> 0.1)
43
- rainbow (>= 2.2.2, < 4.0)
44
- ruby-progressbar (~> 1.7)
45
- unicode-display_width (~> 1.0, >= 1.0.1)
46
- ruby-progressbar (1.9.0)
47
- ruby.py (0.2.1)
48
- pycall
49
- unicode-display_width (1.4.0)
50
-
51
- PLATFORMS
52
- ruby
53
-
54
- DEPENDENCIES
55
- bundler (~> 1.16)
56
- pry
57
- rake (~> 10.0)
58
- rspec (~> 3.0)
59
- rubocop (~> 0.57.2)
60
- tensorflow.py!
61
-
62
- BUNDLED WITH
63
- 1.16.2