tensor_stream 1.0.3 → 1.0.4

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: 408dd69cf3211817d31734564f9a51c9ff9fdfca9ab7f207994f67b2b6d82303
4
- data.tar.gz: f07f0b3ebc776dbd1e836968d5e8c97b9730519c6d57251f14cf7a08581b77a3
3
+ metadata.gz: a5d2223b3321554a5529fc7be45f6be485f66d0024d8b3ff4fadb8adfb20ba2a
4
+ data.tar.gz: 229532234896767058fc8d3dff0897650504345aaed1ce3d57b13d09f017f19e
5
5
  SHA512:
6
- metadata.gz: '079a28b96e99180438059036db170dccbb8437188893031a607fcdebc8e66d6ea6678f1da83bd2bf2a8515434e061867e02f9342d00f5a8aadbceb141465ed09'
7
- data.tar.gz: 1f8556098e4fa005a36e2884a079b9ea862aeef0c077623215430b69201a6e7e56b3fd4e33036f54a5c554cbf17fffe71a792f1984f4ac6fbcb116a14104453e
6
+ metadata.gz: '084f3d8fa7e74fccdbcbc42e004716520e9dc7a0cf7568ecbab8182e21ea0930ee58da9ca262b245e28e38df99e20f7dca029007c4e11030a3f6d62b4dd2e089'
7
+ data.tar.gz: a0c9e9987f557ed3cb301114c8f7bb6a91e1344dfeb96d72fbb4c61d850568e1d73ae8b060cabb655954a1d7b36379579eb221abfb955204454e28eae94cdd03
@@ -1,8 +1,7 @@
1
1
  module TensorStream
2
2
  module TensorMixins
3
3
  def +(other)
4
- TensorStream.check_data_types(self, other)
5
- _op(:add, self, other)
4
+ _op(:add, self, TensorStream.convert_to_tensor(other, dtype: data_type))
6
5
  end
7
6
 
8
7
  def [](index)
@@ -10,22 +9,18 @@ module TensorStream
10
9
  end
11
10
 
12
11
  def *(other)
13
- TensorStream.check_data_types(self, other)
14
12
  _op(:mul, self, TensorStream.convert_to_tensor(other, dtype: data_type))
15
13
  end
16
14
 
17
15
  def **(other)
18
- TensorStream.check_data_types(self, other)
19
16
  _op(:pow, self, TensorStream.convert_to_tensor(other, dtype: data_type))
20
17
  end
21
18
 
22
19
  def /(other)
23
- TensorStream.check_data_types(self, other)
24
20
  _op(:div, self, TensorStream.convert_to_tensor(other, dtype: data_type))
25
21
  end
26
22
 
27
23
  def -(other)
28
- TensorStream.check_data_types(self, other)
29
24
  _op(:sub, self, TensorStream.convert_to_tensor(other, dtype: data_type))
30
25
  end
31
26
 
@@ -67,43 +62,35 @@ module TensorStream
67
62
  end
68
63
 
69
64
  def <(other)
70
- TensorStream.check_data_types(self, other)
71
- _op(:less, self, other)
65
+ _op(:less, self, TensorStream.convert_to_tensor(other, dtype: data_type))
72
66
  end
73
67
 
74
68
  def !=(other)
75
- TensorStream.check_data_types(self, other)
76
- _op(:not_equal, self, other)
69
+ _op(:not_equal, self, TensorStream.convert_to_tensor(other, dtype: data_type))
77
70
  end
78
71
 
79
72
  def >(other)
80
- TensorStream.check_data_types(self, other)
81
- _op(:greater, self, other)
73
+ _op(:greater, self, TensorStream.convert_to_tensor(other, dtype: data_type))
82
74
  end
83
75
 
84
76
  def >=(other)
85
- TensorStream.check_data_types(self, other)
86
- _op(:greater_equal, self, other)
77
+ _op(:greater_equal, self, TensorStream.convert_to_tensor(other, dtype: data_type))
87
78
  end
88
79
 
89
80
  def <=(other)
90
- TensorStream.check_data_types(self, other)
91
- _op(:less_equal, self, other)
81
+ _op(:less_equal, self, TensorStream.convert_to_tensor(other, dtype: data_type))
92
82
  end
93
83
 
94
84
  def and(other)
95
- TensorStream.check_data_types(self, other)
96
- _op(:logical_and, self, other)
85
+ _op(:logical_and, self, TensorStream.convert_to_tensor(other, dtype: data_type))
97
86
  end
98
87
 
99
88
  def matmul(other)
100
- TensorStream.check_data_types(self, other)
101
- _op(:mat_mul, self, other)
89
+ _op(:mat_mul, self, TensorStream.convert_to_tensor(other, dtype: data_type))
102
90
  end
103
91
 
104
92
  def dot(other)
105
- TensorStream.check_data_types(self, other)
106
- _op(:mat_mul, self, other)
93
+ _op(:mat_mul, self, TensorStream.convert_to_tensor(other, dtype: data_type))
107
94
  end
108
95
 
109
96
  def cast(data_type = :float32, name: nil)
@@ -100,6 +100,8 @@ module TensorStream
100
100
  :boolean
101
101
  when :shape, :rank, :shape_n
102
102
  options[:out_type] || :int32
103
+ when :zeros, :ones
104
+ options[:dtype] || :float32
103
105
  when :random_standard_normal, :random_uniform, :glorot_uniform, :truncated_normal
104
106
  passed_data_type || :float32
105
107
  when :concat
@@ -1,5 +1,5 @@
1
1
  module TensorStream
2
- VERSION = "1.0.3".freeze
2
+ VERSION = "1.0.4".freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tensor_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Emmanuel Dayo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-03 00:00:00.000000000 Z
11
+ date: 2019-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler